Proving the inverse of a continuous function is also continuous Let $E, E'$ be metric spaces, $f: E\to E'$ a continuous function. Prove that if $E$ is compact and $f$ is bijective then $f^{-1}:E' \to E$ is continuous.


I know one way to prove it is by showing that if $S\subset E$ and $S$ is closed then $f(s)\subset E'$ is also closed where $s\in S$. Since $S$ is closed then $p_n \in S$ and $p_n \to p_0$ in $E$ then $p_o\in S$. Since $E$ is compact there is a convergent subsequence. How can I do this proof?
For proving it we use the if and only if condition that continuous function bring back closed sets to closed sets.

Let $F$ be a closed set in $E$.
Since $E$ is compact, $F$ is compact.
hence $f(F)$ is compact and hence closed.

Now $(f^{-1})^{-1}(F)=f(F)$ is closed.

Since the choice of $F$ was arbitrary, $(f^{-1})$ brings back closed sets to closed sets. hence $f^{-1}$ is continuous.
Theorem 1:  A mapping f of a metric space X into a metric space Y is continuous on X if and only if $f^{-1}(V)$ is open in X for every open set V in Y.

Theorem 2: $f$ is a continuous mapping of a compact metric space X into a metric space Y. Then $f(X)$ is compact.

Based on Theorem 1, it is suffice to show that $f(V)$ is an open set in Y for every open set V in X.

Fix such a set V. $V^c$ is closed in X, hence compact.  Theorem 2 tells us $f(V^{c})$ is a compact subset of Y and so is closed in Y. Since Y is one-to-one and onto, $f(V)$ is the complement of $f(V^{c})$. Hence $f(V)$ is open.