Continuous bijection between compact and Hausdorff spaces is a homeomorphism 
Exercise: Let $f:(X,\tau)\to (Y,\tau_1)$ be a continuous bijection. If $(X,\tau)$ is compact and $(Y,\tau_1)$ is Hausdorff, prove that $f$ is a homeomorphism.

I tried to prove this on the following way:
First I proved the following Lemma:

Lemma: If $(X,\tau)$ and $(Y,\tau_1) $are compact Hausdorff spaces and $f:(X,\tau)\to(Y,\tau_1)$ is a continuous mapping then $f$ is a closed mapping.

Proof: If $A\subset X$ is compact than it is closed in $(X,\tau)$. Then if $\{a_n:n\in\mathbb{N}\}$ is an arbitrary sequence in A then by the compactness there is a subsequence that converges in A such that $\lim_{n\to\infty}a_{in}=a$ where $a \in A$. By continuity of $f$, $\lim_{n\to\infty} f(a_{in})=f(a)$ so that $f(a)\in f(A)$. So $f(A)$ is compact since the space $(Y,\tau_1)$ is compact then $f(A)$ is closed. So $f$ is a closed mapping.
In the Exercise the function is continuous so if $B\in\tau_1$ then $f^{-1}(B)\in\tau$, now it is left to show that $f$ send open sets to open sets. This is where my problem begins:
Compactness is going to be preserved by continuity of $f$, then $(Y,\tau_1)$ must be compact as every image of a subset of $(X,\tau)$ that would imply that $f$ is a closed mapping by the Lemma. If $C$ is a closed set in $X,\tau$ then $f(X\setminus C)=X\setminus f(C)$ which must be open. However I am not certain about this last step.
Question:
How should I solve the question? Is my proof right?
Thanks in advance!
 A: Your proof that $f$ is closed is (a little) bad. Because you suppose to begin with a closed $A$ not a compact $A$. However this is not a big deal because a closed subset of a compact set is compact. Moreover the fact that $f(A)$ is compact in a compact space $Y$ doesn't necessarily means that is closed$^1$. For this you need the fact that $Y$ is Hausdorff (compact set in an Hausdorff space is closed).
About the second, you're right. A bijection that is also closed is necessarily open because $f(X\backslash C) = Y\backslash f(C)$.
To prove this you can show that each of the sets is included in the other. Let $y\in f(X\backslash C)$ then clearly $y\in Y$ but $y\not \in f(C)$ because $f$ is injective.
On the other hand if $y\in Y$ then since $f$ is onto there exists $x\in X$ such that $f(x)=y$. Moreover if $y\not\in f(C)$ then $x\not\in C$ again because $f$ is injective.



*

*For example if $Y$ is equipped with the trivial topology it is always compact (and every subset of it is compact) but no non-trivial subset is closed.

A: The continuous image of a compact space is compact. We don't need sequences to see this; in fact sequences don't even suffice to see it, in general. The definition of compactness is by open covers, so use that:
If $f:X \to Y$ is continuous, $A \subseteq X$ is compact, then consider an open cover $O_i, i \in I$ of $f[A]$. Then $f^{-1}[O_i], i \in I$ is a cover of $A$ (by basic set theory) and an open cover as $f$ is continuous. So finitely many $f^{-1}[O_i], i \in F$ (so $F \subseteq I$ finite) exist that also cover $A$ and again simple set theory tells us that the $O_i, i \in F$ is a finite subcover of the original cover for $f[A]$. Hence $f[A]$ is compact.
The lemma then follows from the basic fact that if $Y$ is Hausdorff, and $B \subseteq Y$ is compact, then $B$ is closed in $Y$. This too is shown using open covers and the definition of Hausdorffness. Plenty of proofs can be found online.
Now if a bijection $f: X \to Y$ is closed, this is the same as saying its inverse map $g: Y \to X$ is continuous: $g$ is continuous iff $g^{-1}[C]$ is closed for all closed $C \subseteq X$. And $g^{-1}[C] = f[C]$ because $g$ is the inverse of the bijection $f$. As $f$ is a closed map by the lemma, you're done.
