Proof verification: map between compact metric spaces has continuous inverse

I tried to prove following statement:

Let $f: X \rightarrow Y$ be a continuous bijective map between metric spaces. Show that $X$ compact implies $f^{-1}$ continuous.

Attempt:

To show that $f^{-1}$ is continuous, it is sufficient to show that $\forall C \in X$ open, $f(C)$ is also open. (closed and closed would also work).

If $C$ is open in $X$ and $X$ is compact, $C^{c}$ (the complement) is closed and compact.

As $f$ is continuous, $f(C^{c})$ is compact and closed (?) in $Y$.

As $f$ is a bijection, it follows that $f(C^{c})$ is the complement of $f(C)$. This implies that $f(C)$ is open in $Y$ and thus concludes the proof.

My question: Heine Borel implies that a set in a metric space is compact iif it is closed and bounded. This only aplies to $\Bbb{R}^{n}$ and does not hold for more general metric spaces. This is why I am not sure that I can imply the $f(C^{c})$ is actually closed in $Y$ (even thought it has to be compact).

Am I overthinking this or overlooking something?

• I hope it's helpful to refer to this math.stackexchange.com/questions/2111662/… – Li Li Aug 7 '17 at 15:18
• @LiLi I found my "mistake", I only need the implication "compact implies closed and bounded", which holds for all metric spaces. Thanks – Alex Q Aug 7 '17 at 15:48
• BTW:....Corollary: Let $\tau$ and $\tau^*$ be compact $T_2$ topologies on a set $A$ with $\tau\subset \tau^*.$ Then $\tau^*=\tau.$ Proof: Let $X$ be $A$ with the topology $\tau^*$ and let $Y$ be $A$ with the topology $\tau.$ Then $id_A:X\to Y$ is a continuous bijection between compact $T_2$ spaces, so $id_A$ is a homeomorphism..... In other words a strictly stronger topology than a compact $T_2$ topology $\tau$ on $A$ cannot be a compact topology. – DanielWainfleet Aug 8 '17 at 6:02

For the first point, note that $(f^{-1})^{-1}[C] = f[C]$, where the first $-1$ is for the inverse function, and the second for pre-image.