Solution (source code)

= Solution

The map $h:X\to X\times Y$, $h(x)=(x,f(x))$, is continuous: the inverse image of a basic open set $U\times V$ is $U\cap f^{-1}(V)$. Its image is exactly the <graph of a function> $G_f$. The continuous image of a <compact space> is compact, so
$$
\boxed{G_f=h(X)\text{ is compact}}.
$$
The <compact graph of a continuous map> conclusion does not need $Y$ to be Hausdorff. In fact projection onto $X$ is a continuous inverse of $h:X\to G_f$, so the graph is homeomorphic to $X$.