I'm considering functions $f : \mathbb{R} \to \mathbb{R}$ with the codomain extended to the extended reals $\mathbb{R} \cup \{\pm\infty\}.$ Now if $f$ is continuous then the function $g : \mathbb{R} \times \overline{\mathbb{R}} \to \mathbb{R} : (x, y) \mapsto y - f(x)$ is also continuous. Then the graph of $f$ is the set $g^{-1}(\{0\})$ and is therefore closed.
It seems plausible that the converse is true - that is, that if the graph of $f : \mathbb{R} \to \overline{\mathbb{R}}$ is closed then $f$ is continuous - but I wouldn't be too surprised if there's an annoying counterexample.
Is the converse true?
Suppose $f$ is not continuous at some $x_0$. Then there is a sequence $(x_n)$ with $x_n \to x_0$, but $|f(x_n) - f(x_0)|\geq \epsilon >0$ for all $n$.
Switching to a subsequence, we can assume $f(x_n)\to y \in \overline{\mathbb{R}}$, since $\overline{\mathbb{R}}$ is sequentially compact. Since th graph of $f$ is closed, this means $(x_0,y)\in \mathrm{graph} f$ and hence $y=f(x_0)$. Hence, (along the subsequence) $f(x_n)\to y =f(x_0)$, in contradiction to $|f(x_n) - f(x_0)|\geq \epsilon >0$ for all $n$.