I will try to rephrase and try to clarify my steps, the following is a complete proof:
1) $f \colon X \to Y$ is a mapping, where $X$, $Y$ are metric spaces and $X$ is compact. $\mathcal G$ is a graph that is compact by hypothesis.
2) To prove continuity of $f$, we will use the fact that $f$ is continuous if and only if $\lim_{x \to p} f(x) = f(p)$ and that every sequence $x_n \to p$ must have $f(x_n) \to f(p)$ for us to have this limit.
3) Assume $x_n \to x$. The domain set is compact, so $x \in X$.