If are metric spaces, is compact, and the graph of is closed, then is continuous. Any failure of sequential continuity gives a subsequence whose images stay away from the proposed limit; compactness produces a convergent image subsequence, and closedness of the graph forces its limit to be the correct value.
Codex Wiki