[proofplan]
To show $f$ is a homeomorphism, it suffices to show $f^{-1}$ is continuous. We prove this in two stages: first, the [Closed Map Lemma](/theorems/317) shows $f$ is a closed map (continuous from compact to Hausdorff implies closed). Second, a bijective closed map has a continuous inverse, because preimages of closed sets under the inverse are images of closed sets under $f$, which are closed.
[/proofplan]
[step:Show $f$ is a closed map via the Closed Map Lemma]
Since $f: X \to Y$ is [continuous](/page/Continuity), $X$ is compact, and $Y$ is Hausdorff, the [Closed Map Lemma](/theorems/317) applies: $f$ is a closed map. That is, for every [closed set](/page/Closed%20Set) $C \subseteq X$, the image $f(C)$ is closed in $Y$.
[/step]
[step:Prove a bijective closed map has a continuous inverse]
[claim:Closed bijections have continuous inverses]
If $g: A \to B$ is a bijective closed map between [topological](/page/Topology) spaces, then $g^{-1}: B \to A$ is continuous.
[/claim]
[proof]
A [function](/page/Function) between topological spaces is continuous if and only if preimages of closed sets are closed. Let $F \subseteq A$ be closed. The preimage of $F$ under $g^{-1}$ is $(g^{-1})^{-1}(F) = g(F)$ (since $g$ is a bijection, $g^{-1}(b) \in F$ if and only if $b \in g(F)$). Since $g$ is a closed map, $g(F)$ is closed in $B$. Therefore $g^{-1}$ pulls closed sets back to closed sets, and $g^{-1}$ is continuous.
[/proof]
[guided]
The equivalence used here is: a function $h: B \to A$ is continuous if and only if $h^{-1}(F)$ is closed in $B$ for every closed $F \subseteq A$. This is the "closed-set characterisation" of continuity, dual to the standard open-set characterisation.
We apply this to $h = g^{-1}: B \to A$. The preimage of a set $F \subseteq A$ under $g^{-1}$ is $(g^{-1})^{-1}(F)$. We claim this equals $g(F)$.
**Why $(g^{-1})^{-1}(F) = g(F)$:** A point $b \in B$ belongs to $(g^{-1})^{-1}(F)$ if and only if $g^{-1}(b) \in F$, if and only if $b = g(g^{-1}(b)) \in g(F)$. The last step uses bijectivity: $g \circ g^{-1} = \mathrm{id}_B$.
**Closedness:** Let $F \subseteq A$ be closed. Then $(g^{-1})^{-1}(F) = g(F)$, which is closed in $B$ because $g$ is a closed map. Since every closed $F \subseteq A$ has $(g^{-1})^{-1}(F)$ closed in $B$, the function $g^{-1}$ is continuous.
Note that bijectivity is essential for the identity $(g^{-1})^{-1}(F) = g(F)$. For a non-injective closed map, this equality can fail.
[/guided]
[/step]
[step:Conclude $f$ is a homeomorphism]
By the previous steps, $f: X \to Y$ is a continuous bijection with continuous inverse $f^{-1}: Y \to X$. Therefore $f$ is a homeomorphism.
[/step]