Let $$f:X\rightarrow Y,$$ where X and Y are metric spaces and Y is compact. If f has a closed graph $$G_f=\{(x,f(x)):x\in X\},$$
then f is continuous.
My first instinct is to use the fact that if $${x_n}\rightarrow x \;\text{ and }\; \{f(x_n)\} \rightarrow y$$ implies x is in X and f(x)=y, then showing the f is continuous at $(x,y)$, and so continuous on X. Having trouble getting direction on this.