Characterizing continuous functions based on the graph of the function
Solution 1:
This Monthly paper has short simple proofs of the following
THEOREM$\ $ TFAE if $\rm\ f: \mathbb R\to \mathbb R\ $ has a closed graph in $\:\mathbb R^2$
(a)$\rm\ \ f\ $ is continuous.
(b)$\rm\ \ f\ $ is locally bounded.
(c)$\rm\ \ f\ $ has the intermediate value property.
(d)$\rm\ \ f\ $ has a connected graph in $\rm\mathbb R^2$.
More generally the result is merely a special case of R. L. Moore's 1920 characterization of a topological line as a locally compact metric space that is separated into two connected sets by each of its points.
Per request, I've appended the proof of the theorem below.
Solution 2:
The answer is yes. Here's one way to prove it. (There might be a slicker way, but this seems to work.)
Assume $G$ is connected and closed. Let $a\in\mathbb R$ be arbitrary, and let $\epsilon>0$ be given. Because $(a,f(a)-\epsilon)\notin G$, the fact that the complement of $G$ is open implies that there is a product neighborhood of the form $(a-\delta,a+\delta)\times (f(a)-\epsilon-c, f(a)-\epsilon+c)$ contained in the complement of $G$. This means that $|x-a|<\delta$ implies that one of the following two inequalities holds:
- $f(x)\ge f(a)-\epsilon+c>f(a)-\epsilon$, or
- $f(x)\le f(a)-\epsilon-c$.
If there is any $x\in (a-\delta,a+\delta)$ so that the second inequality holds, say $f(b)\le f(a)-\epsilon-c$ (without loss of generality, we may assume $b\lt a$), then the graph of $f$ does not intersect the following set:
$$\\{(b,y): y\ge f(a)-\epsilon \\}\cup \\{(x,f(a)-\epsilon): b\le x \le a\\} \cup \\{(a,y): y\le f(a)-\epsilon\\}.$$
(See the diagram below.) This broken line disconnects $G$, contradicting the assumption that $G$ is connected. Therefore inequality (1) holds when $|x-a|<\delta$.
A similar argument shows that $f(x)\lt f(a)+\epsilon$ when $|x-a|<\delta$.
Putting these together, we conclude that $|x-a|<\delta$ implies $|f(x)-f(a)|<\epsilon$, so $f$ is continuous at $a$.