A continuous function, intuitively, is one whose graph you can draw without lifting your pencil. No jumps. No breaks. No vertical asymptote tearing the curve in two. The value the function has at each point matches the value the function approaches...
Prerequisites
- chapter-03-the-limit
Learning Objectives
- Define continuity at a point and identify continuous functions
- Recognize and classify discontinuities: removable, jump, infinite, oscillating
- State the Intermediate Value Theorem and apply it to prove existence of roots
- Motivate why the IVT, though intuitively obvious, requires the completeness of the reals
- Use the bisection method to find a root of a continuous function numerically
- Identify where a piecewise function is continuous and where it fails to be
- Apply theorems on continuity of compositions, sums, products, and quotients
In This Chapter
- 4.1 The Function That Keeps Its Promises
- 4.2 The Definition of Continuity
- 4.3 Types of Discontinuities
- 4.4 Visualizing the Four Failure Modes
- 4.5 Continuity of Combinations and Compositions
- 4.6 The Intermediate Value Theorem
- 4.7 The Bisection Method
- 4.8 Continuity from One Side
- 4.9 The Extreme Value Theorem
- 4.10 Continuity Is the Hypothesis Behind Everything
- 4.11 A Few Deeper Threads (optional)
- 4.12 Summary
Continuity: Where Functions Behave and Where They Don't
4.1 The Function That Keeps Its Promises
A continuous function, intuitively, is one whose graph you can draw without lifting your pencil. No jumps. No breaks. No vertical asymptote tearing the curve in two. The value the function has at each point matches the value the function approaches as you slide in from either side. The function keeps the promise its neighbors make about it.
That pencil picture is correct, and we will return to it constantly. But like every intuitive notion in calculus, it needs sharpening before we can build on it. Chapter 3 gave us the limit, the tool for talking precisely about "the value a function approaches." Continuity is what we get when that approached value and the actual value finally agree.
Why insist on this? Because nearly every theorem in this book requires continuity as a hypothesis. The Extreme Value Theorem requires it. The Mean Value Theorem (Chapter 9) requires it. The Fundamental Theorem of Calculus (Chapter 14) requires it. The existence and uniqueness of solutions to differential equations (Chapter 19) requires it. Continuity is the quiet load-bearing wall behind the architecture of calculus, and a discontinuous function can collapse each of these theorems — sometimes spectacularly. This connects to a theme that runs through the whole book: calculus is the mathematics of change, and change that is genuinely continuous is what makes the machinery work.
This chapter teaches you to recognize continuity, to classify the precise ways a function can fail to have it, to wield the most important theorem about continuous functions — the Intermediate Value Theorem — and to turn that theorem into a working algorithm, the bisection method, for finding roots.
The Key Insight. Continuity is the statement $\lim_{x\to a} f(x) = f(a)$ — the limit equals the value. It says the function has no surprises: where it is going is where it actually is. Every existence theorem in calculus is, underneath, a way of cashing in that "no surprises" guarantee.
4.2 The Definition of Continuity
We build continuity in three rigor levels, exactly as the book promises: an intuitive picture, a computational rule, then the formal $\varepsilon$–$\delta$ statement.
Intuitive. $f$ is continuous at $a$ if its graph has no break at $a$ — no hole, no jump, no blow-up. You can pass your pencil through $x=a$ without lifting it.
Computational. A function $f$ is continuous at the point $a$ if three conditions all hold:
- $f(a)$ is defined (the point exists);
- $\lim_{x \to a} f(x)$ exists (the neighbors agree on where $f$ is heading);
- $\lim_{x \to a} f(x) = f(a)$ (where it heads is where it is).
If any one of the three fails, $f$ is discontinuous at $a$.
These three conditions are genuinely independent — each can fail while the others hold:
- $f$ undefined at $a$: condition 1 fails. (Example: $\frac{\sin x}{x}$ at $x=0$.)
- the two-sided limit does not exist: condition 2 fails. (Example: the one-sided limits disagree, or $f$ oscillates.)
- both exist but disagree: condition 3 fails. (Example: a graph with a single misplaced dot.)
A function is continuous on an interval if it is continuous at every point of that interval. A function is simply continuous (no qualifier) if it is continuous at every point of its domain.
Common Pitfall. Continuity is a pointwise property: a function is continuous at a point, or it is not. The same function can be continuous at some points and discontinuous at others. The piecewise function defined by $f(x) = x^2$ for $x \neq 1$ and $f(1) = 5$ is continuous everywhere except $x=1$. Do not say a function "is discontinuous" without saying where.
Formal. The $\varepsilon$–$\delta$ definition of Chapter 3 specializes cleanly. Saying $\lim_{x\to a} f(x) = f(a)$ means:
$$\forall\, \varepsilon > 0 \;\; \exists\, \delta > 0 \;\; \text{such that} \;\; |x - a| < \delta \implies |f(x) - f(a)| < \varepsilon.$$
Read it as a challenge–response game. You name a tolerance $\varepsilon$ around the value $f(a)$. If $f$ is continuous at $a$, I can always name a tolerance $\delta$ around the input $a$ so that staying within $\delta$ of $a$ forces $f(x)$ to stay within $\varepsilon$ of $f(a)$. Notice the one difference from a generic limit: here the target value is forced to be $f(a)$ itself, not some separate number $L$. Continuity is the limit "closing the loop" onto the function's own value.
Geometric Intuition. Picture a horizontal band of half-width $\varepsilon$ centered on the height $f(a)$. Continuity at $a$ says: I can find a vertical strip of half-width $\delta$ around $x=a$ so narrow that the graph, inside that strip, never escapes the band. Shrink the band as much as you like; a continuous graph lets me always find a matching strip. A jump discontinuity defeats this — once $\varepsilon$ is smaller than the jump, no strip can keep both sides of the break inside one band.
The Substitution Shortcut
Here is the payoff of continuity that you will use on nearly every page from now on. If $f$ is continuous at $a$, then condition 3 is the statement that
$$\lim_{x \to a} f(x) = f(a),$$
which means you can evaluate the limit by direct substitution — just plug in $a$. The entire labor of Chapter 3 (factoring, rationalizing, squeezing) was needed precisely because the functions there were not continuous at the point of interest. For continuous functions, limits are free.
The Classical Continuous Functions
The following are continuous on their natural domains. These facts require the $\varepsilon$–$\delta$ definition to prove rigorously, but each is intuitively reasonable, and we take them as established:
- Polynomials $p(x) = a_n x^n + \cdots + a_0$ — continuous everywhere on $\mathbb{R}$.
- Rational functions $r(x) = p(x)/q(x)$ — continuous wherever $q(x) \neq 0$.
- Exponentials $e^x$, $b^x$ — continuous everywhere.
- Logarithms $\ln x$, $\log_b x$ — continuous on $(0, \infty)$.
- Sine and cosine $\sin x$, $\cos x$ — continuous everywhere.
- Tangent $\tan x$ — continuous everywhere except where $\cos x = 0$, i.e. at $x = \tfrac{\pi}{2} + k\pi$.
- Roots $\sqrt{x}$ — continuous on $[0, \infty)$, including one-sided continuity at $0$.
Check Your Understanding. Is $f(x) = \dfrac{x^2 + 1}{x^2 - 4}$ continuous at $x = 3$? At $x = 2$? Where is it continuous?
Answer
It is a rational function, continuous wherever the denominator is nonzero. The denominator $x^2-4 = (x-2)(x+2)$ vanishes only at $x = \pm 2$. At $x=3$ the function is continuous, so $\lim_{x\to 3} f = f(3) = \tfrac{10}{5} = 2$ by direct substitution. At $x=2$ it is not continuous — it is undefined there (an infinite discontinuity, since the numerator $5\neq 0$). So $f$ is continuous on $(-\infty,-2)\cup(-2,2)\cup(2,\infty)$.
4.3 Types of Discontinuities
When a function fails to be continuous at a point, the failure has a type. Classifying the failure tells you whether it can be repaired and how the graph behaves nearby. There are three main types, plus one exotic case.
Removable Discontinuity
The two-sided limit exists, but it does not equal $f(a)$ — either because $f(a)$ is undefined or because $f(a)$ is the "wrong" value. The discontinuity could be removed by redefining $f$ at the single point $a$ to match the limit.
Example. $f(x) = \dfrac{x^2 - 1}{x - 1}$. For $x \neq 1$ this simplifies to $x+1$, so $\lim_{x \to 1} f(x) = 2$. But $f(1)$ is undefined (the formula gives $0/0$). Redefine $f(1) = 2$ and the function becomes continuous. The graph is the line $y=x+1$ with a single missing point — a hole — at $(1,2)$.
Example. $g(x) = \begin{cases} x + 1 & x \neq 1 \\ 5 & x = 1 \end{cases}$. Here $\lim_{x \to 1} g(x) = 2$ but $g(1) = 5$. Conditions 1 and 2 hold; condition 3 fails. The graph is the line $y=x+1$ with one dot lifted up to height $5$. Redefine $g(1)=2$ and continuity is restored.
Jump Discontinuity
Both one-sided limits exist, but they are different numbers. The graph leaps from one height to another. This cannot be repaired by changing one value — the gap is real.
Example. The sign function $\operatorname{sgn}(x) = \begin{cases} 1 & x > 0 \\ 0 & x = 0 \\ -1 & x < 0 \end{cases}$ has $\lim_{x \to 0^+}\operatorname{sgn}(x) = 1$ and $\lim_{x \to 0^-}\operatorname{sgn}(x) = -1$. The two-sided limit cannot exist (it would have to equal both $1$ and $-1$). No choice of $\operatorname{sgn}(0)$ fixes this; the jump of size $2$ is intrinsic.
Example. The floor function $\lfloor x \rfloor$ (greatest integer $\le x$) jumps by $1$ at every integer. At $x=2$: $\lim_{x\to 2^-}\lfloor x\rfloor = 1$ while $\lim_{x\to 2^+}\lfloor x\rfloor = 2$. A jump discontinuity at every integer, and continuity everywhere else.
Infinite Discontinuity
A one-sided or two-sided limit is $\pm\infty$. The graph has a vertical asymptote.
Example. $f(x) = 1/x$ at $x=0$: $\lim_{x \to 0^+} 1/x = +\infty$ and $\lim_{x \to 0^-} 1/x = -\infty$. The two sides shoot off in opposite directions.
Example. $f(x) = 1/x^2$ at $x=0$: $\lim_{x \to 0} 1/x^2 = +\infty$ from both sides. Still an infinite discontinuity, but now symmetric.
Oscillating Discontinuity (the exotic case)
The limit fails to exist not because of a jump or a blow-up, but because the function oscillates infinitely fast.
Example. $f(x) = \sin(1/x)$ at $x = 0$. As $x \to 0$, the argument $1/x$ races through every value, so $\sin(1/x)$ sweeps between $-1$ and $1$ infinitely many times in any neighborhood of $0$. Neither one-sided limit exists. No redefinition at $0$ can help, because the problem is in the approach, not the point.
Common Pitfall. Many students see a function written as a single algebraic formula and assume it must be continuous. But $\frac{1}{x}$, $\tan x$, and $\sin(1/x)$ are each one clean formula and each is discontinuous somewhere. The presence of a formula guarantees nothing; you must check the three conditions at suspect points (where a denominator vanishes, where a piecewise rule changes, where an argument blows up).
Check Your Understanding. Classify the discontinuity of $h(x) = \dfrac{x-3}{x^2-9}$ at $x=3$ and at $x=-3$.
Answer
Factor: $h(x) = \frac{x-3}{(x-3)(x+3)} = \frac{1}{x+3}$ for $x\neq 3$. At $x=3$: the limit is $\frac{1}{6}$ (finite), but $h(3)$ is undefined — a removable discontinuity (a hole at $(3,\tfrac16)$). At $x=-3$: the simplified form $\frac{1}{x+3}$ blows up, $\lim_{x\to -3}h = \pm\infty$ — an infinite discontinuity. Same formula, two different failure types.
4.4 Visualizing the Four Failure Modes
Seeing the four cases side by side fixes them in memory. The following code draws a continuous function next to the three repairable-or-not discontinuities. (Geometry and algebra are inseparable — we never state a behavior without picturing it.)
import numpy as np
import matplotlib.pyplot as plt
fig, axes = plt.subplots(1, 4, figsize=(16, 4))
# (0) Continuous: a parabola, no breaks
x = np.linspace(-2, 2, 200)
axes[0].plot(x, x**2 + 1, 'b-')
axes[0].set_title('Continuous: $f(x)=x^2+1$')
# (1) Removable: y = x+1 with a hole at x=1 lifted to height 5
xl = np.linspace(-2, 0.99, 100); xr = np.linspace(1.01, 2, 100)
axes[1].plot(xl, xl + 1, 'b-'); axes[1].plot(xr, xr + 1, 'b-')
axes[1].plot(1, 2, 'wo', markeredgecolor='b', markersize=8) # open hole at the limit
axes[1].plot(1, 5, 'bo', markersize=8) # filled dot at f(1)=5
axes[1].set_title('Removable: hole + misplaced value')
# (2) Jump: the sign function
xl = np.linspace(-2, -0.01, 100); xr = np.linspace(0.01, 2, 100)
axes[2].plot(xl, -np.ones_like(xl), 'b-'); axes[2].plot(xr, np.ones_like(xr), 'b-')
axes[2].plot(0, -1, 'wo', markeredgecolor='b', markersize=8)
axes[2].plot(0, 1, 'wo', markeredgecolor='b', markersize=8)
axes[2].set_title('Jump: sign function')
# (3) Infinite: 1/x with a vertical asymptote
xl = np.linspace(-2, -0.05, 100); xr = np.linspace(0.05, 2, 100)
axes[3].plot(xl, 1/xl, 'b-'); axes[3].plot(xr, 1/xr, 'b-')
axes[3].axvline(x=0, color='gray', linestyle='--'); axes[3].set_ylim(-10, 10)
axes[3].set_title('Infinite: $f(x)=1/x$')
for ax in axes:
ax.grid(True, alpha=0.3)
ax.axhline(0, color='gray', lw=0.5); ax.axvline(0, color='gray', lw=0.5)
plt.tight_layout(); plt.show()
# Figure 4.1: continuous vs. removable vs. jump vs. infinite discontinuity.
Figure 4.1 shows the visual signature of each case: an unbroken curve; a curve with a hole and a stray dot; a curve that leaps; a curve torn apart by an asymptote. Train your eye to read these signatures — most discontinuity classification on an exam is pattern recognition once you know what to look for.
4.5 Continuity of Combinations and Compositions
Continuous functions behave beautifully under arithmetic and composition. This is what lets us declare entire families of functions continuous at a stroke.
Theorem (Continuity of Combinations). If $f$ and $g$ are continuous at $a$, then so are $$f + g, \quad f - g, \quad cf \ (c\text{ constant}), \quad f \cdot g, \quad \text{and} \quad \frac{f}{g} \ \text{provided } g(a) \neq 0.$$
Theorem (Continuity of Composition). If $g$ is continuous at $a$ and $f$ is continuous at $g(a)$, then the composition $f \circ g$ is continuous at $a$.
Where these come from. Each follows directly from the corresponding limit law of Chapter 3. Take the product rule for limits: $\lim_{x\to a}[f(x)g(x)] = \big(\lim_{x\to a} f(x)\big)\big(\lim_{x\to a} g(x)\big)$. If $f$ and $g$ are continuous at $a$, the two limits are $f(a)$ and $g(a)$, so the product's limit is $f(a)g(a) = (fg)(a)$ — which is exactly continuity of $fg$ at $a$. The sum, difference, scalar-multiple, and quotient cases run identically; the quotient needs $g(a)\neq 0$ so we are not dividing by zero in the limit.
The composition theorem is the one worth a closer look, because it is the engine behind the chain rule you will meet in Chapter 7. The key is that continuity lets a limit "pass inside" a continuous function:
$$\lim_{x\to a} f(g(x)) = f\!\left(\lim_{x\to a} g(x)\right) = f(g(a)).$$
The first equality is permitted because $f$ is continuous at the point $g(a)$ — that is precisely the condition that lets you swap "limit then apply $f$" with "apply $f$ then limit."
The practical consequence is enormous. Any function you can assemble from the classical list using $+$, $-$, $\times$, $\div$, and composition is automatically continuous on its domain. For instance $h(x) = \sqrt{\,\cos(x^2) + 3\,}$ is continuous everywhere, because it is a composition of continuous pieces ($x^2$, then $\cos$, then $+3$, then $\sqrt{\ }$) and the inside never goes negative. You do not check three conditions point by point; you certify it by structure.
The Key Insight. Continuity is the rule, not the exception. Almost every function you write down with elementary operations is continuous on its domain. The interesting questions are always where a function fails — at a vanishing denominator, a piecewise seam, or a domain edge — and what kind of failure it is.
Check Your Understanding. For what values of the constant $k$ is the piecewise function $f(x) = \begin{cases} x^2 + k & x \le 2 \\ 3x - 1 & x > 2\end{cases}$ continuous everywhere?
Answer
Each piece is a polynomial, hence continuous on its own region. The only suspect point is the seam $x=2$. Continuity there requires the two pieces to meet: $\lim_{x\to 2^-} f = 2^2 + k = 4+k$ must equal $\lim_{x\to 2^+} f = 3(2)-1 = 5$, and both must equal $f(2)=4+k$. So $4+k = 5$, giving $k = 1$. For any other $k$, there is a jump at $x=2$.
4.6 The Intermediate Value Theorem
We now reach the most important theorem about continuous functions on a closed interval.
Intermediate Value Theorem (IVT). Let $f$ be continuous on the closed interval $[a, b]$, and let $N$ be any number strictly between $f(a)$ and $f(b)$. Then there exists at least one $c \in (a, b)$ with $f(c) = N$.
In plain English: a continuous function on a closed interval takes every value between its two endpoint values. It cannot skip any intermediate height.
Geometric Intuition. Draw a continuous curve from the point $(a, f(a))$ to the point $(b, f(b))$. Now draw the horizontal line $y = N$ for some height $N$ between $f(a)$ and $f(b)$. The curve starts on one side of this line and ends on the other. Since the curve has no breaks — no place to leap over the line — it must cross the line at least once. The $x$-coordinate of a crossing is the guaranteed $c$.
Why IVT Is Not as Obvious as It Looks
The picture makes IVT feel like nothing — of course an unbroken curve crosses a line it straddles. But "obvious" pictures can lie, and here the gap between picture and proof is the whole point.
The theorem is false over the rational numbers. Consider $f(x) = x^2 - 2$ as a function defined only for rational inputs. It is "continuous" in the rational world, $f(1) = -1 < 0$, and $f(2) = 2 > 0$. The intermediate value $N=0$ lies between them, so IVT would demand a point $c$ with $c^2 = 2$. But $\sqrt 2$ is irrational — there is no rational $c$. The curve, drawn over the rationals, manages to get from below the axis to above it without ever touching it, because the axis-crossing point is a "hole" the rationals do not contain.
What rescues IVT over $\mathbb{R}$ is the completeness of the real numbers: $\mathbb{R}$ has no holes. The reals are exactly the number system in which every such crossing point actually exists. So IVT is not a free consequence of "no jumps" — it secretly encodes the deep fact that the real line is a continuum with no gaps. That is why it needs a real proof.
Math Major Sidebar — Proving the IVT. Here is the standard completeness-based argument; it is also the conceptual skeleton of the bisection method below. Suppose $f$ is continuous on $[a,b]$ with $f(a) < 0 < f(b)$ (the case $f(c)=N$ reduces to this by considering $f - N$). Define the set $$S = \{\, x \in [a,b] : f(x) < 0 \,\}.$$ $S$ is nonempty ($a \in S$) and bounded above by $b$, so by the completeness axiom it has a least upper bound $c = \sup S$. We claim $f(c) = 0$. - If $f(c) < 0$, then by continuity $f$ stays negative on a small interval around $c$, so points slightly to the right of $c$ are in $S$ — contradicting that $c$ is an upper bound of $S$. - If $f(c) > 0$, then by continuity $f$ stays positive on a small interval around $c$, so a whole neighborhood to the left of $c$ lies outside $S$ — contradicting that $c$ is the least upper bound.
Both inequalities are impossible, so $f(c) = 0$. The single place the proof uses anything beyond logic is the existence of $\sup S$ — that is completeness, and that is the irreducible content of the theorem.
Why IVT Requires Continuity
Drop continuity and the theorem dies. Take $f(x) = 1/x$ on $[-1, 1]$, patched with $f(0)=0$ to make it defined everywhere. Then $f(-1) = -1$ and $f(1) = 1$. The value $N = \tfrac12$ lies between them, so IVT — if it applied — would promise a $c\in(-1,1)$ with $f(c)=\tfrac12$, i.e. $1/c = \tfrac12$, i.e. $c = 2$. But $2 \notin (-1,1)$: no such $c$ exists in the interval. The function leaps over the value $\tfrac12$ by exploiting its blow-up at $0$. The infinite discontinuity is precisely what lets it skip intermediate values, and IVT fails.
Warning. IVT guarantees at least one solution, never exactly one, and it gives a one-sided implication. A sign change forces a root, but the absence of a sign change does not forbid one: $f(x)=x^2-1$ has $f(-2)=3>0$ and $f(2)=3>0$ (same sign), yet two roots sit between them. IVT is a tool for proving existence, not for ruling it out.
Application: Proving Roots Exist
The most common use of IVT: if $f$ is continuous and $f(a)$ and $f(b)$ have opposite signs, then $0$ lies between $f(a)$ and $f(b)$, so by IVT there is a $c \in (a,b)$ with $f(c) = 0$ — a root.
Example. Does $f(x) = x^3 - 7x + 1$ have a root in $[0, 1]$? Check the endpoints:
$$f(0) = 1 > 0, \qquad f(1) = 1 - 7 + 1 = -5 < 0.$$
The signs differ, and $f$ (a polynomial) is continuous, so by IVT there is at least one root in $(0,1)$. This is a qualitative result: it certifies that a root exists without telling us where. To pin it down, we need a numerical method — and IVT itself hands us one.
4.7 The Bisection Method
The proof of IVT cornered the root inside an ever-shrinking interval. Turn that idea into an algorithm and you get bisection: a foolproof root-finder that needs nothing but continuity and a sign change.
The bisection algorithm. Suppose $f$ is continuous on $[a,b]$ with $f(a)$ and $f(b)$ of opposite signs, so a root lives somewhere in $[a,b]$. Then:
- Compute the midpoint $m = (a+b)/2$ and evaluate $f(m)$.
- If $f(m) = 0$ (or is within tolerance of $0$), you have found the root — stop.
- If $f(m)$ has the same sign as $f(a)$, the sign change must be on the right half, so replace $a$ with $m$.
- Otherwise the sign change is on the left half, so replace $b$ with $m$.
- Repeat. Each pass halves the interval that is guaranteed to contain a root.
After $n$ steps the bracketing interval has length $(b-a)/2^n$, so the uncertainty in the root is cut in half every iteration. To reach a tolerance $\tau$ you need about $\log_2\!\big((b-a)/\tau\big)$ steps — for $b-a=1$ and $\tau = 10^{-8}$, that is roughly $27$ iterations. Slow but utterly reliable.
from typing import Callable
def bisection(f: Callable[[float], float], a: float, b: float,
tol: float = 1e-8, max_iter: int = 100) -> float:
"""Find a root of f in [a, b] by bisection.
Requires f(a) and f(b) to have opposite signs (a guaranteed sign change)."""
fa, fb = f(a), f(b)
if fa * fb > 0:
raise ValueError("f(a) and f(b) must have opposite signs")
for _ in range(max_iter):
m = (a + b) / 2
fm = f(m)
if abs(fm) < tol or (b - a) / 2 < tol:
return m
if fa * fm < 0: # sign change is in [a, m]
b, fb = m, fm
else: # sign change is in [m, b]
a, fa = m, fm
return (a + b) / 2
root = bisection(lambda x: x**3 - 7*x + 1, 0, 1)
print(f"Root: {root:.10f}")
# Root: 0.1432773247
# Check: f(root) = root**3 - 7*root + 1 ≈ -2.0e-08 (essentially zero, within tol)
Bisection is guaranteed to converge for any continuous function bracketing a sign change — that guarantee is IVT made executable. Its convergence is linear: each step gains one bit of precision (roughly one decimal digit every $3.3$ steps). Faster methods exist — Newton's method (Chapter 11) converges quadratically, roughly doubling the number of correct digits each step — but Newton's needs a derivative and a good starting guess, and it can diverge. Bisection asks only for continuity and a sign change, and it never fails. This is the book's recurring trade-off in miniature: hand-checkable reliability versus machine-fast power.
Computational Note. Notice the convergence test uses
abs(fm) < tol OR (b-a)/2 < tol. The first clause stops when the function value is tiny; the second stops when the interval is tiny. You need both, because a function can be small in value far from its root (a shallow, nearly-flat crossing) or steep near it (a small interval while $f$ is still sizable). Robust numerical code brackets the root in both senses. Also notefa * fm < 0cleanly detects a sign change without anyif-ladder on the individual signs.
Worked example — bisection by hand. Let us watch three steps of bisection on $f(x)=x^3-7x+1$ over $[0,1]$, where we already proved (via IVT) that a root hides. Start with $f(0)=1>0$ and $f(1)=-5<0$.
| step | interval $[a,b]$ | midpoint $m$ | $f(m)$ | sign | keep half |
|---|---|---|---|---|---|
| 1 | $[0,\ 1]$ | $0.5$ | $0.5^3-3.5+1=-2.375$ | $-$ | root in $[0,\,0.5]$ |
| 2 | $[0,\ 0.5]$ | $0.25$ | $0.25^3-1.75+1=-0.734$ | $-$ | root in $[0,\,0.25]$ |
| 3 | $[0,\ 0.25]$ | $0.125$ | $0.125^3-0.875+1=0.127$ | $+$ | root in $[0.125,\,0.25]$ |
After three steps the root is pinned to $[0.125, 0.25]$ — already we know its first digit. Each row simply asks "does the midpoint share the sign of the left endpoint?" and keeps the half across which the sign still flips. Continue and the bracket marches toward $0.14327\ldots$, matching the code. Notice we never used a derivative, a formula for the root, or anything but evaluations of $f$ and the logic of IVT.
Real-World Application — Implied volatility in finance. The Black–Scholes formula gives an option's price as a continuous, increasing function of one unknown input, the volatility $\sigma$. Traders observe the market price and need to back out the $\sigma$ that produces it — a root-finding problem $\text{BS}(\sigma) - \text{market price} = 0$. Because the pricing function is continuous and monotonic in $\sigma$, IVT guarantees a unique solution, and bisection (or its refinements) reliably finds it. Every options desk on Earth runs this root-find millions of times a day; "implied volatility" is literally the output of a bisection-style solver.
4.8 Continuity from One Side
Functions defined on a closed interval $[a,b]$ have endpoints with only one neighbor, so we need a one-sided notion of continuity there.
Definition. $f$ is continuous from the right at $a$ if $\lim_{x \to a^+} f(x) = f(a)$, and continuous from the left at $a$ if $\lim_{x \to a^-} f(x) = f(a)$.
A function is continuous at an interior point if and only if it is continuous from both sides there. At the left endpoint $a$ of $[a,b]$ we can only ask for right-continuity (there is nothing to the left), and at the right endpoint $b$ only for left-continuity. This is why "continuous on $[a,b]$" really means: continuous at every interior point, right-continuous at $a$, and left-continuous at $b$.
Example. $\sqrt{x}$ is continuous from the right at $x=0$: $\lim_{x\to 0^+}\sqrt x = 0 = \sqrt 0$. There is no question of left-continuity because $\sqrt x$ is undefined for $x<0$. So $\sqrt x$ is continuous on its whole domain $[0,\infty)$.
For a piecewise function whose formula changes at $x=a$, the one-sided picture is exactly the right diagnostic:
- Continuous at $a$ $\iff$ both one-sided limits exist, agree, and equal $f(a)$.
- Continuous from one side only $\iff$ one one-sided limit matches $f(a)$ but the other does not — the signature of a jump.
4.9 The Extreme Value Theorem
The second great theorem about continuous functions on a closed interval is a pure existence guarantee — the foundation of all of optimization.
Extreme Value Theorem (EVT). If $f$ is continuous on a closed, bounded interval $[a, b]$, then $f$ attains both an absolute maximum and an absolute minimum on $[a,b]$. That is, there exist $c, d \in [a,b]$ with $$f(c) \le f(x) \le f(d) \quad \text{for all } x \in [a,b].$$
EVT does not tell you where the extremes are; it promises only that they exist and are achieved (not merely approached). That promise is what makes optimization (Chapter 10) a well-posed activity: you know in advance that a best value is out there, so the hunt for it — checking critical points and endpoints — is not chasing a mirage.
Both Hypotheses Are Essential
EVT needs both continuity and a closed, bounded interval. Remove either and it collapses:
- Drop continuity. On $(0,1]$ the function $f(x)=1/x$ is continuous, but on the closed interval... actually consider $f$ on $[0,1]$ with $f(0)$ defined arbitrarily and $f(x)=1/x$ for $x>0$: it has no upper bound, blowing up as $x\to 0^+$. The discontinuity at $0$ lets the function escape to $+\infty$, so no maximum is attained.
- Drop closedness. On the open interval $(0,1)$ the perfectly continuous function $f(x)=x$ attains neither a maximum (it approaches $1$ but never reaches it) nor a minimum (it approaches $0$ but never reaches it). The would-be extremes sit exactly at the missing endpoints.
Math Major Sidebar — Why EVT is true. EVT also rests on completeness, via the Bolzano–Weierstrass theorem: every bounded sequence of reals has a convergent subsequence. Sketch: a continuous function on $[a,b]$ is bounded (otherwise pick $x_n$ with $|f(x_n)|\to\infty$; a convergent subsequence $x_{n_k}\to x^*\in[a,b]$ forces $f(x_{n_k})\to f(x^*)$, a finite number — contradiction). Being bounded, the values have a supremum $M$; choose $x_n$ with $f(x_n)\to M$, extract a convergent subsequence $x_{n_k}\to d$, and continuity gives $f(d)=M$. So the supremum is attained at $d$. The minimum argument is identical. The closed, bounded hypothesis is what keeps the subsequence's limit inside the interval — drop it and $d$ can escape, which is exactly how the counterexamples above work.
4.10 Continuity Is the Hypothesis Behind Everything
Step back and notice how often "let $f$ be continuous" will open a theorem from here on. Continuity is not one topic among many; it is the admission ticket to the rest of calculus.
- Extreme Value Theorem (this chapter): an optimum exists to be found.
- Intermediate Value Theorem (this chapter): roots and intermediate values exist.
- The Mean Value Theorem (Chapter 9): requires continuity on $[a,b]$ and differentiability on $(a,b)$.
- The Fundamental Theorem of Calculus (Chapter 14): requires continuity of the integrand; this is what guarantees every continuous function has an antiderivative, and it is the keystone the whole second half of the book is built on.
- Existence and uniqueness for differential equations (Chapter 19): requires continuity of the equation's right-hand side.
- Riemann integrability (Chapter 13): every function continuous on $[a,b]$ is integrable there.
There is also a one-way bridge worth flagging now and proving in Chapter 6: differentiability implies continuity (a function with a tangent line cannot have a break), but not conversely — $|x|$ is continuous at $0$ yet has a corner there and is not differentiable. Continuity is the weaker, more basic property; that is exactly why so many theorems can afford to assume it.
Real-World Application — Why physics trusts calculus. Position, velocity, temperature, pressure, and population all change continuously over short timescales: a planet does not teleport, a fluid's temperature does not jump from $20°$ to $80°$ with no values in between. Because the governing functions are continuous, IVT, EVT, and FTC all apply, and calculus describes these systems flawlessly. Where genuine discontinuities appear — a digital signal flipping between $0$ and $1$, a phase transition, a shock wave — engineers must reach for different mathematics (distribution theory, discrete methods), precisely because the continuity hypothesis has been lost.
Add to Your Modeling Portfolio. Examine the modeling function you chose in Chapter 2 and ask: is it continuous on its natural domain? If yes, you have earned the right to invoke IVT and EVT — record which intermediate-value or guaranteed-extremum statements you can now make about your model. If no, locate every discontinuity and name its type. Biology: a logistic population model $P(t)$ is continuous — so by IVT the population passes through every size between its start and its carrying capacity, and by EVT it has a well-defined maximum growth instant on any closed time window. Economics: a marginal-tax or shipping-cost function is piecewise with jump discontinuities at the brackets — identify each threshold and confirm IVT can fail to guarantee an intermediate cost there. Physics: a projectile's height $h(t)$ is continuous, so IVT guarantees the projectile passes through every height up to its peak, and bisection can numerically find the instant it reaches a target height. Data Science: a logistic-regression score $\sigma(w^\top x)$ is continuous in its weights — so the decision boundary (score $=0.5$) is a genuine level set, and a root-finder can locate the threshold crossing.
4.11 A Few Deeper Threads (optional)
These three ideas extend continuity beyond this chapter; skim or skip on a first pass.
The sequential criterion. Continuity has an equivalent phrasing in terms of sequences: $f$ is continuous at $a$ if and only if for every sequence $x_n \to a$ we have $f(x_n) \to f(a)$. This sequential criterion is often the cleanest way to disprove continuity — exhibit one sequence whose images misbehave. For $f(x)=\sin(1/x)$ at $0$, the sequences $x_n = \tfrac{1}{n\pi}$ and $y_n = \tfrac{1}{(2n+\tfrac12)\pi}$ both tend to $0$, but $f(x_n)=0$ while $f(y_n)=1$, so the images cannot both converge to one value. We will lean on this criterion when we study sequences in Chapter 20.
Uniform continuity. A function is uniformly continuous on a set if a single $\delta$ can be made to work for every point at once (given $\varepsilon$), rather than choosing a fresh $\delta$ at each point. A theorem of real analysis says: a function continuous on a closed, bounded interval is automatically uniformly continuous there. This stronger control is exactly what makes the proof that continuous functions are Riemann integrable (Chapter 13) go through — another debt the integral owes to continuity.
Continuity in higher dimensions. For a function $f:\mathbb{R}^n \to \mathbb{R}$ the definition looks the same — limit equals value — but "approaching $a$" now means approaching from infinitely many directions at once, not just left and right. This makes multivariable continuity far subtler: a function can be continuous along every straight line through a point and still be discontinuous there. We confront this carefully in Chapter 29.
4.12 Summary
A function is continuous at a point when three things line up: the value exists, the limit exists, and the two are equal — compactly, $\lim_{x\to a} f(x) = f(a)$. The classical functions (polynomials, rationals, exponentials, logarithms, trigonometric functions, roots) are continuous on their natural domains, and continuity is preserved by sums, products, quotients (off the zeros of the denominator), and compositions — so essentially everything you build from elementary parts is continuous where it is defined. The practical reward is the substitution shortcut: for continuous functions, limits are computed by plugging in.
Discontinuities come in types — removable (a hole or misplaced value, repairable), jump (one-sided limits disagree, irreparable), infinite (a vertical asymptote), and oscillating (no limit because of infinite wiggle). Classifying the failure tells you everything about the local behavior.
The two foundational theorems about continuous functions on a closed interval are the Intermediate Value Theorem — a continuous function takes every value between its endpoint values, so a sign change forces a root — and the Extreme Value Theorem — a continuous function on a closed, bounded interval attains its absolute maximum and minimum. Neither is a free consequence of "no jumps": both secretly encode the completeness of the real numbers, and both fail the instant continuity or closedness is lost. IVT even becomes a concrete algorithm, the bisection method, which brackets a root and halves the bracket every step — slow but unbreakable.
Above all: continuity is the unspoken hypothesis behind nearly every later theorem — the Mean Value Theorem, the Fundamental Theorem of Calculus, the existence theory for differential equations. Lose continuity and the guarantees evaporate. In Chapter 5 we turn to rates of change, sharpening the limit further until — in Chapter 6 — it produces the derivative, the limit of secant slopes. Continuity will be standing quietly behind every line of that construction.
Continue to: Exercises · Quiz · Case Study 1 · Case Study 2 · Key Takeaways · Further Reading