compact Hausdorff space and continuity

Solution 1:

Show that the pre-image of a closed set under $f$ is closed (lift a closed set first to $X \times \mathbb{R}$ via the projection $X \times \mathbb{R} \to \mathbb{R}$, intersect the result with the graph and project down to $X$).

Alternatively, note that $p_X(x,f(x)) = x$ is a continuous bijection from the graph to $X$. The hypotheses imply that this is a homeomorphism. Then observe that $f = p_{\mathbb R} \circ (p_{X})^{-1}$ is a composition of continuous functions.