$f:\mathbb R \to \mathbb R^n$ be such that $G(f):=\{(x,f(x)):x \in \mathbb R\}$ is closed and connected in $\mathbb R^{n+1}$ , is $f$ continuous ? Let $f:\mathbb R \to \mathbb R^n$ be a function whose graph $G(f):=\{(x,f(x)):x \in \mathbb R\}$ is closed and connected
in $\mathbb R^{n+1}$ , then is $f$ continuous ? 
 A: The claim is indeed true. Suppose that $G(f)$ is closed and connected in $\Bbb{R}^{n+1}$.

Lemma 1. For any sequence $(x_n)$ in $\Bbb{R}$ that converges to $x$, there are only 3 possible limit points of $(f(x_n))$, which are $\pm \infty$ and $f(x)$.

Proof. It suffices to show that any finite limit point of $(f(x_n))$ is $f(x)$. Let $(x_{n_k})$ be any subsequence such that $(f(x_{n_k}))$ converges. Then the sequence $(x_{n_k}, f(x_{n_k}))$ of points also converges to some $(x', y') \in \Bbb{R}^{n+1}$. Since $G(f)$ is closed and $x_{n_k} \to x$, we must have $(x', y') \in G(f)$ and $x' = x$. This implies that $y' = f(x') = f(x)$. Therefore $f(x_{n_k}) \to f(x)$ as desired. ////

Lemma 2. For each $x \in \Bbb{R}$ and $\epsilon > 0$, there exists $\delta > 0$ such that 
  \begin{align*}
\text{either} \quad 
|f(x') - f(x)| < \epsilon
\quad \text{or} \quad
|f(x') - f(x)| > 2\epsilon
\end{align*}
  holds whenever $|x' - x| \leq \delta$.

Proof. Assume otherwise. Then for some $x \in \Bbb{R}$ and some $\epsilon > 0$, we can choose a sequence $x_n \to x$ such that $\epsilon \leq |f(x_n) - f(x)| \leq 2\epsilon$. But this is impossible in view of the Bolzano-Weierstrass theorem and Lemma 1 above. ////

Proof of Claim. Let $x_0 \in \Bbb{R}$ and $\epsilon > 0$ be arbitrary. Choose $\delta > 0$ as in Lemma 2. For brevity, we write $y_0 = f(x_0)$ and $[a, b] = [x_0 - \delta, x_0 + \delta]$. Now we define open sets $L, R \subset \Bbb{R}^{n+1}$ by
$$ L = \begin{cases}
(a, b) \times B_{\epsilon}(y_0),
& |f(a) - y_0| > 2\epsilon, \\
\big( (-\infty, b) \times B_{\epsilon}(y_0) \big) \cup \big( (-\infty, a) \times \Bbb{R}^n \big),
& |f(a) - y_0| < \epsilon,
\end{cases} $$
and likewise
$$ R = \begin{cases}
(a, b) \times B_{\epsilon}(y_0),
& |f(b) - y_0| > 2\epsilon, \\
\big( (a, \infty) \times B_{\epsilon}(y_0) \big) \cup \big( (b, \infty) \times \Bbb{R}^n \big),
& |f(b) - y_0| < \epsilon.
\end{cases} $$
Finally, define $U = L \cup R$ and $V = \operatorname{ext}U = \operatorname{int}(U^c)$. Here, $U$ is constructed so that $\partial U$ contains no point of $G(f)$. Consequently we have $G(f) \subset U \cup V$ and $G(f) \cap U \cap V = \varnothing$. Since $U$ is non-empty, it follows that $V$ is empty. Since $(a, b) \times (B_{\epsilon}(y_0)^c) \subset V$, we have
$$ |f(x) - f(x_0)| < \epsilon \quad \text{whenever } |x - x_0| < \delta. $$
Therefore $f$ is continuous.
