Elementary topology: what is wrong with the proof that a function with connected and locally compact graph is continuous? I didn’t need connectivity

compactnessconnectednesscontinuitygeneral-topologysolution-verification

So a new user posted this question, with the problem:

Let $f:\Bbb R\to\Bbb R$ have a connected and locally compact graph $\Gamma_f:=\{(x,f(x)):x\in\Bbb R\}\subset\Bbb R^2$. Show that $f$ is a continuous map.

I started writing an answer for this post, and was about to hit "send" when I realised my answer never once used the connectivity of the graph:

We want to show that if $(x_n)_{n\in\Bbb N}\subseteq\Bbb R$ is a sequence which converges to $x\in\Bbb R$ then $f(x_n)\to f(x)$. We know that $(x,f(x))$ has a compact neighbourhood $K\subset\Gamma_f$.

Denote the projection maps by $\pi_{1,2}(x,y)=x,y$; since $K$ is compact, $K_1:=\pi_1(K)$ and $K_2:=\pi_2(K)$ are compact since the projection maps are continuous, and they are both neighbourhoods of $x,f(x)$ respectively since the projections maps are open.

Infinitely many of the $(x_n)$ shall lie in $K_1$, so without loss of generality suppose all the $x_n\in K_1$. The sequence $(x_n,f(x_n))\subset K$ and must admit a convergent subsequence, by compactness, hence $(x_{n_k},f(x_{n_k}))$ converges to some $(y,f(y)$ for a subsequence. However, $x_{n_k}\to x$ so we must have $y=x$ and therefore $f(x_{n_k})\to f(x)$. Then all subsequences of $(x_n,f(x_n))$ admit a subsequence convergent to $(x,f(x))$ so we must have $(x_n,f(x_n))\to(x,f(x))$ in $\Gamma_f$ – in particular we must have $f(x_n)\to f(x)$.

What's the (probably quite basic) oversight that I'm making here? I can't see the problem… all connectivity means to me here is that $K$ cannot be open, but this seems a useless observation. I can certainly visualise functions which are discontinuous as their graphs are disconnected, but cannot make the link with that and my "proof".

Best Answer

You are assuming that $K_1$ is a neighborhood of $x$, and this isn't necessarily true. Suppose, for instance, that$$f(x)=\begin{cases}\frac1x&\text{ if }x\ne0\\0&\text{ if }x=0.\end{cases}$$Its graph is locally compact. And $K=\{(0,0)\}$ is a compact neighborhood of $(0,0)$ in $\Gamma_f$. But $\pi_1(K)=\{0\}$, which is not a neighborhood of $0$.

Related Question