Ma · Mathematics

Does a Connected Graph Imply That a Function Is Continuous?

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose an example

    On [0,1], set f(0)=0 and f(x)=sin(1/x) for x>0.

  2. 2. Check discontinuity

    As x approaches zero, f(x) takes values 1 and −1 along sequences, so it has no limit.

  3. 3. Check connectedness

    The graph over (0,1] is connected, and (0,0) is in its closure; adjoining that point preserves connectedness.

A function can be discontinuous even if its graph is a connected subset of the plane. The key is that connectedness rules out a separation into two disjoint relatively open pieces; it does not require the graph to vary continuously with the input.

A standard example is the function on [0,1][0,1] defined by

f(x)={0,x=0,sin⁡(1/x),0<x≤1.f(x)=\begin{cases} 0, & x=0,\\ \sin(1/x), & 0<x\leq 1. \end{cases}

This function is not continuous at 00, but its graph is connected in R2\mathbb{R}^2.

Why the function is discontinuous

Continuity at zero would require f(x)f(x) to approach f(0)=0f(0)=0 as xx approaches zero from the right. Instead, the function continues to oscillate between −1-1 and 11.

For example, take the sequences

xn=1π/2+2πn,yn=13π/2+2πn.x_n=\frac{1}{\pi/2+2\pi n},\qquad y_n=\frac{1}{3\pi/2+2\pi n}.

Both sequences approach zero. But

f(xn)=1,f(yn)=−1f(x_n)=1,\qquad f(y_n)=-1

for every nonnegative integer nn. Since these values do not approach a common limit, ff is not continuous at zero. In particular, its limit at zero does not exist.

Why the graph is connected

Let G+G_+ be the part of the graph corresponding to 0<x≤10<x\leq 1:

G+={(x,sin⁡(1/x)):0<x≤1}.G_+=\{(x,\sin(1/x)):0<x\leq 1\}.

The interval (0,1](0,1] is connected, and the map x↦(x,sin⁡(1/x))x\mapsto (x,\sin(1/x)) is continuous on that interval. The continuous image of a connected set is connected, so G+G_+ is connected.

The full graph adds just one point, (0,0)(0,0). That point lies in the closure of G+G_+: for instance, xn=1/(nπ)x_n=1/(n\pi) tends to zero and, for positive integers nn, sin⁡(1/xn)=sin⁡(nπ)=0\sin(1/x_n)=\sin(n\pi)=0. Thus the graph contains points (xn,0)(x_n,0) approaching (0,0)(0,0).

A useful general fact is that if AA is connected and a point pp lies in the closure of AA, then A∪{p}A\cup\{p\} is connected. To see why, suppose this union could be split into two disjoint, nonempty, relatively open sets. Connectedness forces all of AA to lie in one side. The other side would then contain only pp; but because pp is in the closure of AA, no relative neighborhood of pp can avoid AA. That contradicts the supposed separation. Applying this fact to G+G_+ and (0,0)(0,0) proves that the full graph is connected.

What connectedness does and does not tell you

For a continuous function on a connected domain, the graph is connected: the graph is the continuous image of the domain under x↦(x,f(x))x\mapsto (x,f(x)). The example shows that the reverse implication fails. A connected graph may have increasingly rapid oscillations near a point, as long as the graph does not split into two separated pieces.

Connectedness is a topological property of the graph as a whole. Continuity is a local condition on the function: nearby inputs must produce nearby outputs. One property does not substitute for the other.

Common mistakes

  • Confusing the graph with its closure. The example’s graph is connected, but it is not closed. Its closure includes the entire vertical segment {0}×[−1,1]\{0\}\times[-1,1], since values near zero accumulate throughout that interval. The graph itself contains only (0,0)(0,0) above x=0x=0.
  • Assuming oscillation makes the graph disconnected. Oscillation prevents a limit, but does not by itself create a separation of the graph into disjoint relatively open pieces.
  • Checking only one sequence. To show discontinuity, it is enough to find sequences approaching the input along which the function values have incompatible limits. Here one sequence gives values constantly equal to 11, and another gives values constantly equal to −1-1.

So a connected graph is not enough to conclude continuity. You need the function’s values to approach the value at each point, not merely for the graph to form one connected set.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.