Skip to content

Continuity

In this lesson you’ll learn the definition of continuity at a point and on a set, the sequential characterization, the three types of discontinuity, and the theorem that continuous functions pull back open sets to open sets. This is where limits become a property of functions rather than of points.

ff is continuous at aa if

ε>0  δ>0  such that  xa<δ    f(x)f(a)<ε\forall \varepsilon>0 \; \exists\delta>0 \; \text{such that} \; |x - a| < \delta \implies |f(x) - f(a)| < \varepsilon

Compare the limit definition. Two changes, and both matter.

  • The condition is xa<δ|x-a| < \delta, not 0<xa<δ0 < |x-a| < \delta. The point aa is included now.
  • The target is f(a)f(a), not some separate LL.

So continuity at aa packages three requirements:

  1. f(a)f(a) is defined.
  2. limxaf(x)\lim_{x\to a}f(x) exists.
  3. They are equal.
limxaf(x)=f(a)\lim_{x\to a} f(x) = f(a)

That one equation is the whole definition, and each of the three parts can fail independently.

Removable. The limit exists but the value is wrong or missing. f(x)=x24x2f(x) = \frac{x^2-4}{x-2} has limit 4 at x=2x=2 and no value there; defining f(2)=4f(2)=4 repairs it. Hence “removable.”

Jump. The one-sided limits both exist and differ, so no value at the point can help. xx\frac{|x|}{x} at 0 is the model, and so is any step function. Common in physical models with switching behaviour.

Essential. No limit exists at all. sin1x\sin\frac1x at 0. Nothing can be redefined to fix it, because there is nothing to converge to.

ff is continuous at aa     \iff for every sequence xnax_n \to a, we have f(xn)f(a)f(x_n) \to f(a).

Notice xn=ax_n = a is now allowed, unlike the limit version. In words: continuous functions commute with limits.

limnf(xn)=f(limnxn)\lim_{n\to\infty} f(x_n) = f\left(\lim_{n\to\infty}x_n\right)

That is what “continuous” buys you, and it is why continuity is the hypothesis whenever you want to move a function inside a limit.

Same practical benefit as before: to disprove continuity, find one sequence xnax_n \to a with f(xn)↛f(a)f(x_n) \not\to f(a).

If f,gf, g are continuous at aa then so are f+gf+g, cfcf, fgfg, and f/gf/g when g(a)0g(a) \ne 0. These follow from the sequential characterization plus the algebraic limit theorems - no new epsilon-delta work.

Composition deserves its own statement:

If gg is continuous at aa and ff is continuous at g(a)g(a), then fgf \circ g is continuous at aa.

Proof (sequential). Let xnax_n \to a. Continuity of gg gives g(xn)g(a)g(x_n) \to g(a). Continuity of ff at g(a)g(a) gives f(g(xn))f(g(a))f(g(x_n)) \to f(g(a)). ∎

Two lines, versus a genuinely fiddly epsilon-delta argument with two nested tolerances. This is the sequential criterion paying off.

Consequences: polynomials are continuous everywhere; rational functions are continuous where the denominator is nonzero; sin\sin, cos\cos, exp\exp are continuous everywhere; x\sqrt x is continuous on [0,)[0,\infty); and any composition of these is continuous on its natural domain.

f:RRf: \mathbb{R}\to\mathbb{R} is continuous     \iff f1(V)f^{-1}(V) is open for every open VV.

Preimages of open sets are open. This is the definition used in general topology, where there is no ε\varepsilon to speak of.

Note it is about preimages. Images of open sets need not be open: f(x)=x2f(x) = x^2 maps the open (1,1)(-1,1) to [0,1)[0,1), which is not open. And a constant function maps every open set to a single point.

This characterization is what made the “continuous image of a compact set is compact” proof in the last lesson work, and it is why compactness and continuity interact so cleanly.

Define

f(x)={xxQ0xQf(x) = \begin{cases} x & x \in \mathbb{Q} \\ 0 & x \notin \mathbb{Q}\end{cases}

This is continuous at exactly one point, x=0x = 0, and discontinuous everywhere else.

At 0: f(x)x|f(x)| \le |x| always, so δ=ε\delta = \varepsilon works. At any a0a \ne 0: sequences of rationals approaching aa give images approaching aa, while sequences of irrationals give images approaching 0, and a0a \ne 0.

The point of the example: continuity is a pointwise condition, and the set where a function is continuous can be extremely strange. Intuition about curves you can draw is not a guide.

Example 1: Show f(x)=3x+1f(x) = 3x+1 is continuous everywhere.

Solution. Fix aa. Given ε>0\varepsilon>0, take δ=ε3\delta = \frac{\varepsilon}{3}. If xa<δ|x-a|<\delta then

f(x)f(a)=3x+13a1=3xa<3δ=ε|f(x)-f(a)| = |3x+1-3a-1| = 3|x-a| < 3\delta = \varepsilon

Here δ\delta depends on ε\varepsilon only, not on aa. That extra property is uniform continuity, coming in three lessons.

Example 2: Classify the discontinuity of f(x)=x29x3f(x) = \frac{x^2-9}{x-3} at x=3x=3.

Solution. For x3x \ne 3, f(x)=x+3f(x) = x+3, so limx3f(x)=6\lim_{x\to3}f(x) = 6. But f(3)f(3) is undefined.

The limit exists, so the discontinuity is removable. Setting f(3)=6f(3) = 6 makes it continuous.

Example 3: Classify the discontinuity of the floor function at an integer.

Solution. At x=2x = 2: x=1\lfloor x \rfloor = 1 for x[1,2)x \in [1,2) and =2= 2 for x[2,3)x \in [2,3).

limx2x=1,limx2+x=2\lim_{x\to2^-}\lfloor x\rfloor = 1, \qquad \lim_{x\to2^+}\lfloor x\rfloor = 2

Both one-sided limits exist and differ, so this is a jump discontinuity of size 1. No redefinition helps.

The floor function is continuous at every non-integer, so its set of discontinuities is Z\mathbb{Z} - infinite but isolated.

Example 4: Show f(x)=1xf(x) = \frac1x is continuous on (0,)(0,\infty).

Solution. Fix a>0a > 0. From the limits lesson,

1x1a=xaax\left|\frac1x-\frac1a\right| = \frac{|x-a|}{|ax|}

Take δ=min(a2,εa22)\delta = \min\left(\frac a2, \frac{\varepsilon a^2}{2}\right). Then xa<a2|x-a|<\frac a2 gives x>a2x>\frac a2, so ax>a22|ax| > \frac{a^2}{2}, and

1x1a<2xaa2<2a2εa22=ε\left|\frac1x-\frac1a\right| < \frac{2|x-a|}{a^2} < \frac{2}{a^2}\cdot\frac{\varepsilon a^2}{2} = \varepsilon

Continuous at every point of (0,)(0,\infty). There is no discontinuity at 0 to classify, because 0 is not in the domain - ”1x\frac1x is discontinuous at 0” is a common but incorrect phrasing.

Example 5: Continuity of a composition.

Show h(x)=x2+1h(x) = \sqrt{x^2+1} is continuous on R\mathbb{R}.

Solution. Write h=fgh = f\circ g with g(x)=x2+1g(x) = x^2+1 and f(u)=uf(u) = \sqrt u.

gg is a polynomial, continuous everywhere. And g(x)1>0g(x) \ge 1 > 0 for all xx, so gg maps into [1,)[1,\infty) where ff is continuous.

By the composition theorem, hh is continuous on all of R\mathbb{R}. ∎

The check that gg lands where ff is continuous is the step people skip, and it is the step that fails for something like x21\sqrt{x^2-1}.

Example 6: Disprove continuity with one sequence.

Let f(x)=1f(x) = 1 for x0x \ge 0 and f(x)=0f(x) = 0 for x<0x<0. Show ff is discontinuous at 0.

Solution. Take xn=1n0x_n = -\frac1n \to 0. Then f(xn)=0f(x_n) = 0 for every nn, so f(xn)0f(x_n) \to 0.

But f(0)=10f(0) = 1 \ne 0. By the sequential characterization, ff is not continuous at 0. ∎

One sequence suffices, since the characterization requires every sequence to work.

Example 7: Preimages, not images.

For f(x)=x2f(x) = x^2, compare f((1,1))f((-1,1)) with f1((1,1))f^{-1}((-1,1)).

Solution. The image is f((1,1))=[0,1)f((-1,1)) = [0,1), which is not open - 0 has no room to wiggle inside it.

The preimage is f1((1,1))={x:x2<1}=(1,1)f^{-1}((-1,1)) = \{x : x^2 < 1\} = (-1,1), which is open.

Continuity guarantees the second, never the first. Getting the direction backwards is a standard error, and the topological definition is stated with preimages precisely because that is the version that is true.

Numerical root finding. Bisection requires continuity to guarantee a sign change encloses a root. Applied to a discontinuous function it can converge confidently to a jump where no root exists, which is a real failure mode in practice.

Physical modelling. Jump discontinuities model switching: a thermostat, a diode turning on, a phase transition. Recognizing which type of discontinuity a model has determines whether standard numerical solvers apply or whether the problem must be split into smooth pieces.

Computer graphics. Visible seams and banding are discontinuities in a shading function. Texture filtering and level-of-detail transitions are engineered to be continuous, and often to have continuous derivatives too, because the eye detects even a derivative jump as a crease.

Signal processing. Discontinuities in a signal have infinite frequency content, which is why a sharp edge produces ringing after band-limited reconstruction. The Gibbs phenomenon is a jump discontinuity’s signature.

Optimization. Most solvers assume continuity, and many assume more. A discontinuous objective breaks gradient methods and can break even derivative-free ones, since neighbouring evaluations no longer predict nearby behaviour.

Finance. Asset prices are usually modelled as continuous paths, but jump-diffusion models add discontinuities explicitly to capture crashes. The choice changes both the mathematics and the hedging strategy.

What does continuity of f at a require?
How does the continuity definition differ from the limit definition?
What kind of discontinuity does the floor function have at x = 2?
Why is the sequential characterization useful for proving compositions are continuous?
For a continuous f, which is guaranteed?
The function equal to x on the rationals and 0 on the irrationals is continuous at how many points?