If the graph $G(f)$ of $f : [a, b] \rightarrow \mathbb{R}$ is path-connected, then $f$ is continuous.
Here's a different argument.
Suppose $\{x_n\}$ is a sequence in $[a,b]$ converging to some $x$. We will show that there is a subsequence so that $f(x_{n_k}) \to f(x)$. This is sufficient; for if $f$ were not continuous at $x$, there would exist an $\epsilon$ such that for any $n$ we could find an $x_n$ with $|x_n - x| < 1/n$ but $|f(x_n) - f(x)| > \epsilon$. Then we would have $x_n \to x$, but no subsequence of $\{f(x_n)\}$ could converge to $x$, contradicting our claim.
Since the graph of $f$ is path connected, there is a continuous path $c(t) = (u(t), v(t))$ with $v(t) = f(u(t))$ for each $t$, and $c(0) = (a, f(a))$, $\gamma(1) = (b, f(b))$. By the intermediate value theorem, for each $n$ there is a $t_n \in [0,1]$ with $u(t_n) = x_n$. Since $[0,1]$ is compact, we can find a subsequence $t_{n_k}$ converging to some $t$. Then by continuity of $u$, since $u(t_{n_k}) = x_{n_k} \to x$, we have $u(t) = x$. Now $v$ is also continuous, so $$f(x_{n_k}) = f(u(t_{n_k})) = v(t_{n_k}) \to v(t) = f(u(t)) = f(x).$$ We have thus constructed the desired subsequence.
Here is a very simple proof which reduces everything to a couple of standard general topology theorems. Let $G=G_f\subset {\mathbb R}^2$ denote the graph of $f: [a,b]\to {\mathbb R}$. Observe that the projection map $p: G\to [a,b]$ (given by the projection to the first component) is a continuous bijective map, its inverse is $x\mapsto (x, f(x))$. Hence, it suffices to show that $p$ is a homeomorphism. You probably already know that a continuous bijective map from a compact space to a Hausdorff space is a homeomorphism. Hence, it suffices to show that $G$ is compact. Since $G$ is path-connected, there exists a continuous map $\gamma: [0,1]\to G$ sending $0$ to $A=(a,f(a))$ and $1$ to $B=(b,f(b))$. I claim that this map is surjective. If not, then composing it with $p$ we obtain a continuous non-surjective map $[a,b]\to [a,b]$ which fixes the end-points, contradicting the Intermediate Value Theorem. Thus, $\gamma$ is surjective, which implies that $G$ is compact (a continuous image of a compact space is compact). qed
Edit. This proof also suggests a higher-dimensional generalization of this result:
Lemma. Let $B^n$ be the $n$-dimensional closed unit ball, $f: B^n\to X$ a map to a Hausdorff topological space such that the restriction of $f$ to $\partial B^n$ is continuous. Then the following are equivalent:
$f$ is continuous.
The graph $G_f$ of $f$ is contractible. (Path connected is, obviously, insufficient.)
The restriction $(id, f): \partial B^n\to G_f$ defines a null-homologous spherical cycle $g: S^{n-1}\to G_f$ (more precisely, the image of the homotopy class $[g]$ under the Hurewicz homomorphism $\pi_n(G_f)\to H_n(G_f)$ is zero).
The proof is essentially the same as written above: Assume (3). If $\sum_i a_i \sigma_i$ is a singular $n$-chain whose boundary is the spherical cycle $g$, then the union of images of the singular simplices $\sigma_i$ has to be the entire $G_f$ (otherwise, it misses a point $(q,f(q))$ and, hence, the boundary of $B^n$ is null-homologous in $B^n -\{q\}$, which is impossible). But then $G_f$ is compact, hence, the projection map $G_f\to B^n$ is a homeomorphism, hence, $f$ is continuous. The implications (1)$\Rightarrow$(2) and (2)$\Rightarrow$(3) are clear.