Proof (topological inverse function theorem)

It suffices to show that for all closed subset $U\subseteq X$, $(f\inv)\inv(U) = f(U) \subseteq Y$ is closed.

Since $X$ is compact and $U$ is closed, $U$ is compact, so $f(U)$ is also compact. Since $Y$ is Hausdorff, $f(U)$ is closed.

(In a metric space, the last implication can instead be that $f(U)$ is compact $\implies$ sequentially compact $\implies$ closed.)