Let $f:X\rightarrow Y$ be any map. The graph of f is the set $\Gamma_f=\{(x,f(x))| x\in X\}\subset X \times Y$.
Assume that Y is compact. Prove that if $\Gamma_f \subset X \times Y$ is closed then $f$ is continous.
I was able to prove the converse (where it was also given that Y is Hausdorff), but I'm having trouble proving this direction.
Assume $F\subseteq Y$ is a closed set. Then $(X\times F)\cap\Gamma_f$ is closed in $X\times Y$ as a finite intersection of closed sets. Now define the projection $\pi:X\times Y\to X$ by $(x,y)\to x$. Since $Y$ is compact this is a closed map. Hence $f^{-1}(F)=\pi((X\times F)\cap\Gamma_f)\subseteq X$ is closed in $X$. So we proved that the inverse image of any closed set is closed and this is equivalent to continuity.