Let $X$ and $Y$ be metric spaces and Y be a compact space. To show that a function $f : X \to Y$ is continuous iff its graph $G(f) = \{ (x,f(x)) \in X \times Y \}$ is closed in $X \times Y$.
I have done the part that if $f$ is continuous then its graph $G(f) = \{ (x,f(x)) \in X \times Y \}$ is closed in $X \times Y$.
But having difficulty in the other direction that if its graph $G(f) = \{ (x,f(x)) \in X \times Y \}$ is closed in $X \times Y$ then $f : X \to Y$ is continuous.
Is $Y$ required to be Hausdorff for graph $G(f) = \{ (x,f(x)) \in X \times Y \}$ is closed in $X \times Y$ assuming that $f$ is continuous?