Topic · Calculus

Continuity

A function is continuous at a point when its value there is exactly where the function was heading. No jumps, no holes, no blow-ups — the graph passes through the point without lifting the pen. That apparently modest property is the gate every serious theorem in calculus has to pass through.

What you'll leave with

  • The three-part test for continuity at a point — and how each part can fail independently.
  • The four standard kinds of discontinuity, and how to tell which one you're looking at.
  • The two big existence theorems for continuous functions on $[a, b]$ — IVT and EVT — and what they buy you.
  • The "no gaps" reading of IVT that powers every root-finding argument in calculus.
  • Why sums, products, and compositions of continuous functions are automatically continuous — so you almost never have to check.

1. The three conditions for continuity at a point

Limits answer the question where is the function headed near $a$? Continuity asks the follow-up: and does it actually arrive? Those are two genuinely different questions, and lining them up is the whole content of the definition.

Continuous at a point

A function $f$ is continuous at $a$ if all three of the following hold:

  1. $f(a)$ is defined,
  2. $\displaystyle\lim_{x \to a} f(x)$ exists, and
  3. $\displaystyle\lim_{x \to a} f(x) = f(a).$

The three conditions look redundant at first — surely the third implies the others? It does not. Each one can fail on its own:

  • Condition 1 fails when the function has no value at $a$ at all: a division by zero, a logarithm of a non-positive number, a piecewise rule that skips the point.
  • Condition 2 fails when the limit doesn't exist — left and right approaches disagree, or the function oscillates, or it shoots off to infinity.
  • Condition 3 fails when both $f(a)$ and $\lim_{x \to a} f(x)$ exist but happen to be different numbers — the function is defined at $a$, but lands somewhere other than where it was headed.

The economical way to state all three at once is the single equation

$$ \lim_{x \to a} f(x) \;=\; f(a). $$

This is more than a slogan. Read it as a contract: the limit exists, $f(a)$ exists, and they match. Whenever you see continuity used in a proof, this is the move being invoked — you may freely swap "the limit" for "the value at the point", because for continuous functions those are the same thing.

Reading the picture

Informally, $f$ is continuous at $a$ if you can draw the graph through the point $(a, f(a))$ without lifting your pen. Every formal failure of continuity shows up in the picture as a hole, a jump, a vertical asymptote, or a fuzzy oscillation.

2. A zoo of discontinuities

When continuity fails, it fails in one of a small handful of recognisable ways. Naming the species matters — different repair strategies apply, and some failures are far worse than others.

Removable

limit exists · value missing or wrong

a

$\displaystyle\lim_{x \to a} f(x)$ exists, but $f(a)$ is undefined or sits elsewhere. The graph has a single missing point — patch it by redefining $f$ at $a$ and the function becomes continuous.

Jump

one-sided limits exist · they disagree

a

Left- and right-hand limits both exist but land at different values. The graph steps from one height to another. No single redefinition can fix this.

Infinite

function diverges · vertical asymptote

a

$|f(x)| \to \infty$ as $x \to a$. The graph blows up; there's a vertical asymptote at $a$. The limit doesn't exist (as a finite number) and no value of $f(a)$ can help.

Essential

limit doesn't exist · oscillatory

a

The function neither settles nor diverges — it oscillates faster and faster as $x \to a$. The classic example is $\sin(1/x)$ at $0$. No single $L$ exists.

Each kind has a canonical example worth committing to memory:

KindExampleBehaviour at the bad point
Removable$f(x) = \dfrac{x^2 - 4}{x - 2}$ at $x = 2$Undefined, but $\lim = 4$. Patch with $f(2) := 4$ and you have $x + 2$.
Jump$f(x) = \operatorname{sgn}(x)$ at $x = 0$Left limit $-1$, right limit $+1$. No two-sided limit.
Infinite$f(x) = \dfrac{1}{x^2}$ at $x = 0$$\lim = +\infty$. Vertical asymptote.
Essential$f(x) = \sin\!\left(\dfrac{1}{x}\right)$ at $x = 0$Oscillates between $-1$ and $1$ with ever-shrinking period.
Severity ranking

Removable discontinuities are essentially clerical — one redefinition and they're gone. Jumps are real but tame: both sides exist, they just don't match. Infinite and essential discontinuities are the genuinely violent ones: the function has no useful value near $a$ at all, and no amount of redefinition rescues it.

3. Continuity on an interval

"Continuous" is a local property — it lives at a single point. What we almost always actually want is continuity over a whole stretch of the real line:

Continuous on an interval

$f$ is continuous on an interval $I$ if it is continuous at every point of $I$. At a closed endpoint, one-sided continuity is enough: $\lim_{x \to a^+} f(x) = f(a)$ at a left endpoint, $\lim_{x \to b^-} f(x) = f(b)$ at a right endpoint.

The endpoint clause is the only subtlety. A function defined on $[0, 1]$ has nothing to its left at $x = 0$ — there's no two-sided limit to ask about. So at endpoints we only require the function to approach its value from inside the interval.

A short catalogue of functions that are continuous on their entire natural domain:

  • Every polynomial — continuous on all of $\mathbb{R}$.
  • $\sin x$, $\cos x$, $e^x$ — continuous on all of $\mathbb{R}$.
  • $\tan x$ — continuous everywhere except the odd multiples of $\pi/2$ (infinite discontinuities there).
  • $\dfrac{1}{x}$ — continuous on $(-\infty, 0) \cup (0, \infty)$, with an infinite discontinuity at $0$.
  • $\ln x$ — continuous on $(0, \infty)$. Outside that interval the function isn't defined, so the question doesn't arise.
  • Rational functions $\dfrac{p(x)}{q(x)}$ — continuous wherever $q(x) \neq 0$.

This list is most of what you actually meet. The reason it works as a list is the closure result of the next section: continuous functions stay continuous under almost every operation algebra lets you perform.

4. Combining continuous functions

The reason "is this function continuous?" is rarely a hard question in practice is that continuity is closed under everything you'd naturally do to functions.

Suppose $f$ and $g$ are continuous at $a$. Then so are:

  • $f + g$ and $f - g$ — sums and differences;
  • $cf$ for any constant $c$ — scalar multiples;
  • $f \cdot g$ — products;
  • $f / g$, provided $g(a) \neq 0$ — quotients.

And — the most useful one — if $g$ is continuous at $a$ and $f$ is continuous at $g(a)$, then the composition $f \circ g$ is continuous at $a$:

$$ \lim_{x \to a} f(g(x)) \;=\; f\!\left(\lim_{x \to a} g(x)\right) \;=\; f(g(a)). $$

The middle equality is the headline: for continuous $f$, you may pull the limit through the function. This is the formal reason expressions like $\lim e^{x^2 - 1}$ can be evaluated by direct substitution — the exponential is continuous everywhere, so the limit passes inside.

Every theorem in this section has the same shape: an algebraic operation, plus continuity of the pieces, gives continuity of the result. Put together, they turn the question "is this expression continuous at $a$?" into the much easier question "are all of its building blocks continuous at $a$, and do I never divide by zero?"

In practice

Anything you can build from polynomials, $\sin$, $\cos$, $\exp$, $\ln$, and roots — using sums, products, quotients, and compositions — is continuous on every point of its natural domain. You almost never have to fall back to the three-condition test by hand; you just check the domain.

5. The Intermediate Value Theorem

Now we get the payoff. The next two theorems are why continuity is worth so much fuss: each one extracts a strong global fact about a function from the comparatively mild assumption that it is continuous on a closed interval $[a, b]$.

Intermediate Value Theorem (IVT)

If $f$ is continuous on $[a, b]$ and $v$ is any number between $f(a)$ and $f(b)$, then there is at least one $c \in (a, b)$ with $f(c) = v$.

The picture is the whole proof. Imagine plotting $f$ on $[a, b]$. The two endpoints sit at heights $f(a)$ and $f(b)$. If you pick any horizontal line at a height $v$ between them, the graph cannot avoid that line — there's no way to get from one side to the other without crossing. Continuous functions can't skip values.

y = v a c b f(a) f(b) f(c) = v

Root-finding: the canonical application

The single most-used corollary takes $v = 0$. If $f$ is continuous on $[a, b]$ and $f(a)$ and $f(b)$ have opposite signs, then somewhere strictly inside the interval the function must equal zero. There has to be a root.

Concrete instance. Does $x^3 - x - 1 = 0$ have a solution between $1$ and $2$? Let $f(x) = x^3 - x - 1$. Then $f$ is a polynomial, so it's continuous on $[1, 2]$. Evaluate the endpoints:

$$ f(1) = 1 - 1 - 1 = -1, \qquad f(2) = 8 - 2 - 1 = 5. $$

The endpoint values have opposite signs, so by IVT there exists some $c \in (1, 2)$ with $f(c) = 0$. We don't know where, exactly — but we know it's there. That is exactly the leverage IVT gives you: existence without construction.

What IVT does not give you

IVT promises at least one $c$, not exactly one. The graph could cross $y = v$ multiple times. And it gives no recipe for finding $c$ — only its existence. To actually locate $c$ you need a numerical method (bisection is the natural one, and it's IVT in disguise).

6. The Extreme Value Theorem (and boundedness)

The second great existence theorem for continuous functions on a closed interval is about maxima and minima.

Extreme Value Theorem (EVT)

If $f$ is continuous on $[a, b]$, then $f$ attains a maximum and a minimum on $[a, b]$. That is, there exist points $x_{\min}, x_{\max} \in [a, b]$ with $$ f(x_{\min}) \;\le\; f(x) \;\le\; f(x_{\max}) \quad \text{for every } x \in [a, b]. $$

The verb "attains" carries the entire claim. The function doesn't just stay below some ceiling — it actually reaches that ceiling at some specific point in the interval. The supremum is not merely the limit of values; it is itself a value.

EVT immediately yields a weaker but useful statement:

Boundedness Theorem

If $f$ is continuous on $[a, b]$, then $f$ is bounded on $[a, b]$ — there exists $M$ with $|f(x)| \le M$ for all $x \in [a, b]$.

This follows from EVT in one line: take $M = \max\{|f(x_{\min})|, |f(x_{\max})|\}$. Continuous functions cannot misbehave wildly on a closed interval; they're hemmed in on both sides.

Why the hypotheses are essential

EVT looks innocuous, but every word in "continuous on a closed bounded interval" is doing work. Drop any one of them and the conclusion fails.

  • Drop closedness. Consider $f(x) = x$ on $(0, 1)$. It's continuous on the open interval, but attains neither a max nor a min — it gets arbitrarily close to $0$ and to $1$ without ever reaching them.
  • Drop boundedness. Consider $f(x) = x$ on $[0, \infty)$. It's continuous on a closed interval, but the interval is unbounded — there is no maximum.
  • Drop continuity. Define $f$ on $[0, 1]$ by $f(x) = 1/x$ for $x > 0$ and $f(0) = 0$. The interval is closed and bounded, but $f$ has an infinite discontinuity at $0$ and never attains its supremum.

The trio — continuous, closed, bounded — is exactly what gets you to "max and min exist". In more advanced language (real analysis), the right abstraction is compactness, and EVT is the special case for the real line: a continuous image of a compact set is compact, and compact subsets of $\mathbb{R}$ attain their bounds.

The optimisation pipeline

EVT is what licences the standard recipe for finding extrema on a closed interval, the one you'll meet in earnest with derivatives:

  1. Check that $f$ is continuous on $[a, b]$. (Usually obvious.)
  2. List candidate points: the interior critical points of $f$ (where $f'$ is zero or undefined) together with the two endpoints $a$ and $b$.
  3. Evaluate $f$ at each candidate.
  4. The largest value is the maximum; the smallest is the minimum. EVT is what guarantees you weren't searching for something that doesn't exist.

Without EVT, step 4 is wishful thinking. With EVT, it's a theorem.

7. Common pitfalls

Treating "removable" as "already continuous"

A removable discontinuity is still, strictly, a discontinuity. The function as written is not continuous at the bad point; it merely can be made continuous by a single redefinition. When a theorem demands continuity, the unpatched function does not qualify.

Conflating continuous with differentiable

Continuity is a much weaker condition than differentiability. $|x|$ is continuous at $0$ but has no derivative there. Weierstrass even constructed a function that is continuous everywhere on $\mathbb{R}$ but differentiable nowhere. The implication only runs one way: differentiable $\Rightarrow$ continuous, never the reverse.

Applying IVT without checking continuity

IVT's conclusion fails routinely for non-continuous functions. A piecewise-constant function can jump straight over a target value. Always state — and verify — that $f$ is continuous on the closed interval before invoking IVT.

Applying EVT on an open or unbounded interval

$f(x) = 1/x$ is continuous on $(0, 1]$ — but it has no maximum, because as $x \to 0^+$ the function shoots off to infinity. The closed-and-bounded hypothesis is not decorative. Make a habit of confirming both "closed" and "bounded" before reaching for EVT.

"IVT gives me the root"

IVT promises a root exists; it does not name one. Students sometimes write "by IVT, $c = 1.5$" — which is wrong twice over (the theorem doesn't pin down $c$, and there may be more than one root). Use IVT for existence claims, and a numerical method (bisection, Newton's) when you actually need a value.

8. Worked examples

Try each one before opening the solution. The point is to recognise which definition or theorem to reach for, not to memorise the specific answers.

Example 1 · Check continuity at a point

Let $f(x) = \dfrac{x^2 - 9}{x - 3}$ for $x \neq 3$, and $f(3) = 5$. Is $f$ continuous at $x = 3$?

Step 1. $f(3)$ is defined: $f(3) = 5$. ✓

Step 2. The limit. Factor and cancel:

$$ \lim_{x \to 3} \frac{x^2 - 9}{x - 3} \;=\; \lim_{x \to 3} \frac{(x - 3)(x + 3)}{x - 3} \;=\; \lim_{x \to 3} (x + 3) \;=\; 6. $$

So the limit exists and equals $6$. ✓

Step 3. Does the limit equal $f(3)$? We have limit $= 6$ but $f(3) = 5$. ✗

Conclusion. $f$ is not continuous at $x = 3$ — condition 3 fails. The discontinuity is removable: redefining $f(3) := 6$ would make $f$ continuous there.

Example 2 · Classify the discontinuity of a piecewise function

Let $$ f(x) \;=\; \begin{cases} x + 1, & x < 0, \\ 2, & x = 0, \\ x^2 + 3, & x > 0. \end{cases} $$ Classify the discontinuity at $x = 0$ (if any).

Left limit. $\displaystyle\lim_{x \to 0^-} f(x) = \lim_{x \to 0^-} (x + 1) = 1.$

Right limit. $\displaystyle\lim_{x \to 0^+} f(x) = \lim_{x \to 0^+} (x^2 + 3) = 3.$

Both one-sided limits exist, but they differ ($1 \neq 3$), so the two-sided limit does not exist. This is a jump discontinuity — the value $f(0) = 2$ is irrelevant to the classification; the diagnosis comes entirely from the sides disagreeing.

Example 3 · Use IVT to guarantee a root

Show that $\cos x = x$ has a solution in $[0, 1]$.

Define $g(x) = \cos x - x$. We want to find $c \in [0, 1]$ with $g(c) = 0$.

Continuity. $\cos x$ and $x$ are both continuous on $\mathbb{R}$, so $g$ is continuous (difference of continuous functions) — in particular on $[0, 1]$. ✓

Endpoint values.

$$ g(0) = \cos 0 - 0 = 1, \qquad g(1) = \cos 1 - 1 \approx 0.540 - 1 = -0.460. $$

$g(0) > 0$ and $g(1) < 0$, so $0$ lies strictly between $g(0)$ and $g(1)$.

IVT. There exists $c \in (0, 1)$ with $g(c) = 0$, i.e. $\cos c = c$. The existence of a fixed point of $\cos$ on $[0, 1]$ is established — without ever computing it.

Example 4 · Use EVT (and see where it fails)

(a) Does $f(x) = x^3 - 3x$ attain a maximum and minimum on $[-2, 2]$?

$f$ is a polynomial, hence continuous on the closed bounded interval $[-2, 2]$. By EVT, yes — both a max and a min are attained. (To find them, you'd evaluate $f$ at the interior critical points $x = \pm 1$ and at the endpoints $\pm 2$, then pick the largest and smallest.)

(b) Does $f(x) = 1/x$ attain a maximum on $(0, 1]$?

$f$ is continuous on $(0, 1]$, but the interval is not closed at the left endpoint. As $x \to 0^+$, $f(x) \to +\infty$, so $f$ is unbounded above. No maximum exists. EVT does not apply, and the conclusion correspondingly fails.

(c) Does $f(x) = x$ attain a maximum on $[0, \infty)$?

$f$ is continuous on a closed interval, but the interval is unbounded. $f$ has no maximum. EVT does not apply.

Moral. Closed and bounded — both clauses are load-bearing.

Example 5 · Continuity from combining building blocks

Where is $h(x) = \dfrac{e^{\sin x}}{x^2 - 4}$ continuous?

Break $h$ into pieces:

  • $\sin x$ is continuous on $\mathbb{R}$.
  • $e^u$ is continuous on $\mathbb{R}$, so the composition $e^{\sin x}$ is continuous on $\mathbb{R}$.
  • $x^2 - 4$ is a polynomial — continuous everywhere — and is zero exactly when $x = \pm 2$.
  • A quotient of continuous functions is continuous wherever the denominator is non-zero.

So $h$ is continuous on $\mathbb{R} \setminus \{-2, 2\}$. At $x = \pm 2$ the numerator is non-zero ($e^{\sin(\pm 2)} \neq 0$) while the denominator is zero, so those are infinite discontinuities — vertical asymptotes.

Sources & further reading

The content above is synthesized from established calculus references. If any claim here reads ambiguously, the primary sources are the ground truth — and the "deeper" links are where to turn when this page has served its purpose.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 20
0 correct