I had asked this question: Characterising Continuous functions some time back, and this question is more or less related to that question.
Suppose we have a function $f: \mathbb{R} \to \mathbb{R}$ and suppose the set $G = \\{ (x,f(x) : x \in \mathbb{R}\\}$ is connected and closed in $\mathbb{R}^{2}$, then does it imply $f$ is continuous?