[proofplan]
We prove both implications from the definition of a homeomorphism as a bijective continuous map whose inverse is continuous. In the forward direction, the inverse map carries closed subsets of $X$ to closed preimages in $Y$, and those preimages are exactly the images under $f$. In the reverse direction, the hypothesis that $f$ is closed turns complements of open subsets of $X$ into closed subsets of $Y$, which proves continuity of the inverse map.
[/proofplan]
[step:Show that a homeomorphism is continuous and closed]
Assume that $f$ is a homeomorphism. By definition, $f$ is continuous, and its inverse map
\begin{align*}
g: Y \to X
\end{align*}
is continuous, where $g(y)$ is the unique point $x \in X$ such that $f(x) = y$.
Let $C \subset X$ be closed in $X$. Then $X \setminus C$ is open in $X$. Since $g$ is continuous, $g^{-1}(X \setminus C)$ is open in $Y$. Hence its complement $Y \setminus g^{-1}(X \setminus C)$ is closed in $Y$. By the definition of preimage under $g$,
\begin{align*}
Y \setminus g^{-1}(X \setminus C) = g^{-1}(C).
\end{align*}
Since $g = f^{-1}$, we have $g^{-1}(C) = f(C)$. Therefore $f(C)$ is closed in $Y$. Since $C \subset X$ was arbitrary, $f$ is closed.
[/step]
[step:Use closedness of the bijection to prove continuity of the inverse]
Assume that $f$ is continuous, closed, and bijective. Define the inverse map
\begin{align*}
g: Y \to X
\end{align*}
by letting $g(y)$ be the unique point $x \in X$ satisfying $f(x) = y$.
Let $O \subset X$ be open in $X$. Then $X \setminus O$ is closed in $X$, so $f(X \setminus O)$ is closed in $Y$ because $f$ is closed. We claim that
\begin{align*}
g^{-1}(O) = Y \setminus f(X \setminus O).
\end{align*}
Indeed, for any $y \in Y$, surjectivity of $f$ gives a point $x \in X$ with $y = f(x)$, and the definition of $g$ gives $g(y) = x$. Thus $y \in g^{-1}(O)$ exactly when $x \in O$, which is exactly when $x \notin X \setminus O$. By injectivity of $f$, this is equivalent to $y \notin f(X \setminus O)$. This proves the claimed identity.
Since $f(X \setminus O)$ is closed in $Y$, its complement $Y \setminus f(X \setminus O)$ is open in $Y$. Therefore $g^{-1}(O)$ is open in $Y$. Since $O \subset X$ was arbitrary and open, $g$ is continuous.
[guided]
We need to prove that the inverse map is continuous. Since continuity between topological spaces is tested by preimages of open sets, we start with an arbitrary open subset $O \subset X$ and prove that its preimage under the inverse map is open in $Y$.
Because $f$ is bijective, the inverse map is well-defined:
\begin{align*}
g: Y \to X
\end{align*}
where $g(y)$ is the unique point $x \in X$ such that $f(x) = y$. The word "unique" uses both parts of bijectivity: surjectivity gives existence of such an $x$, and injectivity gives uniqueness.
Let $O \subset X$ be open in $X$. Its complement $X \setminus O$ is closed in $X$. The hypothesis that $f$ is closed says that the image of every closed subset of $X$ is closed in $Y$, so $f(X \setminus O)$ is closed in $Y$.
The key point is to identify the preimage $g^{-1}(O)$ with the complement of this [closed set](/page/Closed%20Set). We claim that
\begin{align*}
g^{-1}(O) = Y \setminus f(X \setminus O).
\end{align*}
To prove this identity, take any $y \in Y$. Since $f$ is surjective, there exists $x \in X$ such that $y = f(x)$. By definition of $g$, this point satisfies $g(y) = x$. Now $y \in g^{-1}(O)$ if and only if $g(y) \in O$, which is equivalent to $x \in O$. This is equivalent to $x \notin X \setminus O$.
Because $f$ is injective, the condition $x \notin X \setminus O$ is equivalent to saying that $y = f(x)$ is not in $f(X \setminus O)$. Indeed, if $y$ were equal to $f(x')$ for some $x' \in X \setminus O$, then injectivity would force $x' = x$, contradicting $x \notin X \setminus O$. Hence
\begin{align*}
y \in g^{-1}(O) \iff y \in Y \setminus f(X \setminus O).
\end{align*}
Since $y \in Y$ was arbitrary, the claimed identity follows.
Now $f(X \setminus O)$ is closed in $Y$, so its complement $Y \setminus f(X \setminus O)$ is open in $Y$. Therefore $g^{-1}(O)$ is open in $Y$. Since this holds for every open subset $O \subset X$, the inverse map $g: Y \to X$ is continuous.
[/guided]
[/step]
[step:Conclude the equivalence]
In the forward direction, we proved that every homeomorphism is continuous and closed. In the reverse direction, assuming that $f$ is continuous, closed, and bijective, we proved that its inverse map $g = f^{-1}: Y \to X$ is continuous. Therefore $f$ is a bijective continuous map with continuous inverse, so $f$ is a homeomorphism. This proves the desired equivalence.
[/step]