Bijective continuous map from compact space to NON HAUSDORFF SPACE prove homeomorphism

Let $X,Y$ be topological spaces with $X$ compact and let $f:X \to Y$ be continuous and bijective. Prove that $f$ is a homeomorphism.

First of all, the image of a compact space under a continuous map is compact. Thus by the bijectivity of $f$, $Y$ is also compact. Now I am not sure, how to proceed. Can anyone give me a hint?

This isn't true. For instance, take any finite set with more than one element and let $X$ be that set with the discrete topology and $Y$ be that set with the indiscrete topology. Then $X$ is compact and the identity map is a continuous bijection $X\to Y$, but it is not a homeomorphism.
• In fact, take any compact space $X$, and let $Y$ be the set $X$ with any topology strictly weaker than that of $X$. The identity map from $X$ to $Y$ is a continuous bijection, $Y$ is compact (because any open cover in the topology of $Y$ is still an open cover in the topology of $X$), but this is not a homeomorphism. – Robert Israel Sep 30 '16 at 23:05
• Is the exercise true if $X$ and $Y$ are both Hausdorff as well? – Alan Yan Sep 8 '18 at 6:23
• @AlanYan: Yes, it is. Actually, you just need $Y$ to be Hausdorff. – Eric Wofsey Sep 8 '18 at 14:12