Characterizing continuous functions based on the graph of the function 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?

Yes, I think so.
First, observe that such $f$ must have the intermediate value property.  For suppose not; then there exist $a < b$ with (say) $f(a) < f(b)$ and $y \in (f(a),f(b))$ such that $f(x) \ne y$ for all $x \in (a,b)$.  Then $A = (-\infty,a) \times \mathbb{R} \cup (-\infty,b) \times (-\infty,y)$ and $B = (b, +\infty) \times \mathbb{R} \cup (a,+\infty) \times (y,+\infty)$ are disjoint nonempty open subsets of $\mathbb{R}^2$ whose union contains $G$, contradicting connectedness.  (Draw  a picture.)
Now take some $x \in \mathbb{R}$, and suppose $f(x) < y < \limsup_{t \uparrow x} f(t) \le +\infty$. Then there is a  sequence $t_n \uparrow x$ with $f(t_n) > y$ for each $n$.  By the intermediate value property, for each $n$ there is $s_n \in (t_n, x)$ with $f(s_n) = y$.  So $(s_n, y) \in G$ and $(s_n,y) \to (x,y)$, so since $G$ is closed $(x,y) \in G$ and $y = f(x)$, a contradiction.  So $\limsup_{t \uparrow x} f(t) \le f(x)$.  Similarly, $\limsup_{t \downarrow x} f(t) \le f(x)$, so $\limsup_{t \to x} f(t) \le f(x)$.  Similarly, $\liminf_{t \to x} f(t) \ge f(x)$, so that $\lim_{t \to x} f(t) = f(x)$, and $f$ is continuous at $x$.
