# function with path connected graph

Let $f : (a,b) \to \mathbb R$ be a function with path connected graph, then is $f$ necessarily continuous ?

If the domain was instead of the form $[a,b]$, then I can show $f$ is continuous from path connectedness of the graph, but I don't know what happens in other cases.

• @Mirko: In $[a,b]$, the result is true, as also shown in this sight. math.stackexchange.com/questions/366747/… (one of the reasons I don't like geometric arguments unless it can be explicitly written down ... ) – user495643 Dec 22 '17 at 20:23
• looking at the link you provided math.stackexchange.com/questions/366747/… (indicating that the result for $[a,b]$ is true), I realized I was misinterpreting your question. I erased my older comments and posted what I believe is a detailed and correct answer now. – Mirko Dec 22 '17 at 23:07

The positive answer for an open interval $(a,b)$ easily follows from the positive answer for a closed interval $[a,b]$. I first wrote an answer along these lines, but now I prefer the following alternative proof (moving the older version at the end).

I prefer to give an alternative, self-contained and direct proof that covers both cases $(a,b)$ and $[a,b]$ simultaneously.

Suppose that $f:D\to\mathbb R$ has a path-connected graph, where $D$ is a connected subset of $\mathbb R$ (that is, an interval, open, or closed, or half-open, finite or infinite). We claim that $f$ is continuous.

Take any $p\in D$. It is enough to show that $f$ is continuous at $p$ from the left (assuming $p$ is not a left-endpoint of $D$), and that $f$ is continuous at $p$ from the right (assuming $p$ is not a right-endpoint of $D$). Of course, by symmetry, it would also be enough to consider just one of these cases.

Assume, towards a contradiction, that $f$ is discontinuous from the right at some $p$ (where $p$ is not a right-endpoint of $D$). Then there is some $\varepsilon>0$ and a monotone decreasing sequence of points $p_n\in D$, converging to $p$, and such that $|f(p)-f(p_n)|\ge\varepsilon$ for all $n\ge0$.

There is a path $\gamma:[0,1]\to G(f)$ in the graph $G(f)$ from $\langle p_0,f(p_0)\rangle$ to $\langle p,f(p)\rangle$. Each vertical line $x=p_n$ separates the plane, and $\gamma(0)=\langle p_0,f(p_0)\rangle$ whereas $\gamma(1)=\langle p,f(p)\rangle$, hence for each $n$ there is $t_n\in[0,1]$ such that $\gamma(t_n)=\langle p_n,f(p_n)\rangle$. The sequence of the $t_n$ is bounded and hence has a convergent subsequence. Without loss of generality (replacing the sequence of the $p_n$ with a suitable subsequence) we may assume that the sequence of the $t_n$ itself is converging, say to some $s$. By continuity of $\gamma$ we must have that $\gamma(t_n)$ converges to $\gamma(s)$. But $\gamma(t_n)=\langle p_n,f(p_n)\rangle$ and the first coordinates converge to $p$, so we must have that $\gamma(t_n)$ converges to $\langle p,f(p)\rangle,$ which is the unique point of the graph on the vertical line $x=p$. Hence $\gamma(s)=\langle p,f(p)\rangle$. But the second coordinates of $\gamma(t_n)=\langle p_n,f(p_n)\rangle$, namely the $f(p_n)$ are distance at least $\varepsilon$ away from $f(p)$, hence cannot converge to $f(p)$. This contradiction completes the proof.

Note that we cannot replace the assumption that the graph of $f$ is path-connected with the weaker assumption that it is connected. An example is $f(x)=\sin\frac1x$ for $x\not=0$, and $f(0)=0$ (as discussed at http://at.yorku.ca/cgi-bin/bbqa?forum=ask_a_topologist_2002&task=show_msg&msg=0356.0001 ).

Here is also an older version of my answer, showing how the positive answer for an open interval $(a,b)$ follows from the known (to the OP) positive answer for a closed interval $[a,b]$.

Say $f : (a,b) \to \mathbb R$ is a function with a path connected graph. It is enough to show that the restriction of $f$ to $[c,d]$ is continuous whenever $a<c<d<b$. For the latter, it is enough to show that the graph of this restriction is path-connected (making use of the known result for closed intervals).

Take any $p$ and $q$ with $c\le p<q\le d$. Let $\gamma:[0,1]\to G(f)$ be a path, where $G(f)$ is the graph of $f,$ with $\gamma(0)=\langle p,f(p)\rangle$ and $\gamma(1)=\langle q,f(q)\rangle$. Let $t_0$ be the largest value of $t$ such that $\gamma(t)$ is on, or to the left of, the vertical line $x=p$. Note that $\gamma(t_0)$ must be on the line $x=p$ (or else we get a contradiction with the definition of $t_0$), and in particular (since $f$ is a function, and applying the vertical line test), we have that $\gamma(t_0)=\langle p,f(p)\rangle$. Let $t_1$ be the smallest value of $t>t_0$ such that $\gamma(t)$ is on, or to the right of, the vertical line $x=q$. Then the restriction of $\gamma$ to $[t_0,t_1]$ is a path from $\langle p,f(p)\rangle$ to $\langle q,f(q)\rangle$, remaining inside the graph of the restriction of $f$ to $[p,q]$, and hence also inside the graph of the restriction of $f$ to $[c,d]$.

The above shows that the graph of the restriction of the $f$ to $[c,d]$ is path-connected, and hence, using the known result for closed intervals, the restriction of $f$ to $[c,d]$ is continuous. It follows that $f$ is continuous on $(a,b)$.

Edit 12/27/2017, answering the first comment below:
"How did you get that for each $n$ there is $t_n$ with $\gamma(t_n)=(p_n,f(p_n))$ ? – misao".

Let $V$ be the vertical line $\{(x,y):x=p_n\}$. It splits the plane into the open left and right half-planes $L=\{(x,y):x<p_n\}$ and $R=\{(x,y):x>p_n\}$. The image under $\gamma$ of $[0,1]$, namely $\gamma([0,1])$, is connected, since $\gamma$ is continuous and $[0,1]$ is connected. Also, $\gamma([0,1])$ intersects both $L$ and $R$ (one in $\gamma(1)$, the other in $\gamma(0)$, assuming here that $n>0$, so $p<p_n<p_0$, since for $n=0$ clearly $t_0=0$ works). Then $\gamma([0,1])$ must intersect $V$, for otherwise $(\gamma([0,1])\cap L)\cup(\gamma([0,1])\cap R)$ would be a relatively closed-and-open partition by non-empty sets of $\gamma([0,1])$, contradicting that the latter is connected. Say $(p_n,y_n)\in\gamma([0,1])\cap V$. But then $(p_n,y_n)\in\gamma([0,1])\subseteq G(f)$, and hence $y_n=f(p_n)$, since $f$ is a function, it passes the vertical line test, there is a unique point in $G(f)\cap V$ and this unique point is $(p_n,f(p_n))$. (That is, $f$ has a unique value at $p_n$.) At the same time, since $(p_n,y_n)\in\gamma([0,1])$, there must be $t_n$ such that $(p_n,y_n)=\gamma(t_n)$. Thus $\gamma(t_n)=(p_n,y_n)=(p_n,f(p_n))$.

• How did you get that for each $n$ there is $t_n$ with $\gamma(t_n)=(p_n , f(p_n) )$ ? – user495643 Dec 27 '17 at 10:06
• @misao I added an edit at the end of my answer, clarifying the point in your comment. – Mirko Dec 28 '17 at 3:34