Differentiability Implies Continuity

Suppose a function has a well-defined instantaneous rate of change at a point. Does it follow that the function cannot jump or tear at that point? This is one of the first genuinely structural questions a calculus student meets after the derivative is defined. It asks how two different local properties of a function relate to each other. These properties are the existence of a limiting slope, and the absence of a break in the graph. The answer is a clean one-way implication. Understanding exactly why it is one-way, rather than an equivalence, is one of the most instructive exercises in single-variable analysis. The result matters because it justifies a huge amount of downstream machinery. Every time we invoke the Algebraic Rules of Differentiation or the Mean Value Theorem, we are implicitly relying on a key fact. Differentiable functions behave well enough to be continuous. There are no jumps to worry about. There is no need to separately check continuity before applying these theorems. In practice, this theorem is what lets analysts treat "differentiable" as a strictly stronger, more restrictive condition than "continuous." It also lets them organize the whole hierarchy of smoothness classes (C0⊂C^0 \subset differentiable ⊂C1⊂C2⊂⋯\subset C^1 \subset C^2 \subset \cdots) around that ordering. The big picture is a hierarchy of regularity. Continuity says the function has no jumps. Differentiability says the function has no jumps and no corners. This holds in the precise sense that it admits a well-defined tangent line. Having a tangent line is a strictly stronger geometric requirement than merely being unbroken. So it should not be surprising that differentiability forces continuity but not conversely. The classical example of Weierstrass's continuous nowhere-differentiable function shows just how enormous the gap between the two classes really is. This article proves the implication rigorously from the difference-quotient definition of the derivative. It builds the intuition for why the algebra works. It then exhibits the standard counterexample — f(x)=∣x∣f(x) = |x| at x=0x=0. This shows that continuity alone never guarantees differentiability. Along the way we clarify the exact logical relationship between the two properties. We also flag the most common student error: assuming the converse.

Key takeaways
  • If ff is differentiable at aa, then ff is continuous at aa. This is a genuine theorem, not a definition.
  • The proof is a one-line algebraic trick: write f(x)−f(a)f(x) - f(a) as a product of the difference quotient and (x−a)(x-a), then take limits.
  • The converse is false: continuity does not imply differentiability, as f(x)=∣x∣f(x) = |x| shows at x=0x = 0.
  • Differentiability is a strictly stronger condition than continuity; the containment (differentiable ⊂\subset continuous) is proper.
  • This theorem underwrites later results like the Mean Value Theorem, where differentiability hypotheses are used precisely because they guarantee no jumps.
  • Key idea: a finite derivative forces f(x)−f(a)→0f(x) - f(a) \to 0 as x→ax \to a, because it is the product of a bounded (convergent) quantity and a quantity going to 00.

Where this lives today

This theorem is a load-bearing fact throughout analysis and its applications, even though it is usually invoked silently.

  • Foundations of calculus. The Mean Value Theorem, Rolle's theorem, and the Algebraic Rules of Differentiation (sum, product, quotient, chain rules) all implicitly rely on differentiable functions being continuous; proofs of these theorems routinely use continuity of ff (guaranteed by differentiability) as a stepping stone, for instance to invoke the Extreme Value Theorem on a closed interval.
  • Numerical analysis. Newton's method and other root-finding algorithms assume differentiability of the target function; the guaranteed continuity is what makes local linear approximations behave predictably rather than jumping unpredictably between iterations.
  • Physics and engineering. Physical quantities modeled as differentiable functions of time (position, velocity in classical mechanics) are automatically guaranteed to have no instantaneous jumps, consistent with physical continuity of motion; this is one reason velocity profiles derived from smooth position functions never "teleport."
  • Optimization and machine learning. Gradient-based optimization methods (gradient descent, backpropagation) require differentiability of loss functions; the guaranteed continuity underlies convergence proofs and the reasonable behavior of loss landscapes near differentiable points, and non-differentiable "kinks" (like ReLU's corner at 00, directly analogous to ∣x∣|x|) are handled by subgradient methods precisely because ordinary differentiability fails there.
  • Complex analysis. The complex-analytic analogue — complex differentiability (holomorphicity) implies continuity — is proved by an identical difference-quotient argument, and turns out to have vastly stronger consequences (analytic functions are infinitely differentiable), making the real-variable story here a gentle preview of a much richer phenomenon.
  • Probability and statistics. Continuity of cumulative distribution functions is often established via differentiability of an underlying density, using this same implication to guarantee no atoms (jumps) in absolutely continuous distributions.

Ask the tutor: Why does having all partial derivatives exist at a point not guarantee continuity there, even though ordinary one-variable differentiability does?

DefinitionDifferentiability and continuity at a point

Let ff be a real-valued function defined on an open interval containing the point a∈Ra \in \mathbb{R}.

Continuity. We say ff is continuous at aa if

lim⁡x→af(x)=f(a).\lim_{x \to a} f(x) = f(a).

Equivalently, for every ε>0\varepsilon > 0 there exists δ>0\delta > 0 such that ∣x−a∣<δ|x - a| < \delta implies ∣f(x)−f(a)∣<ε|f(x) - f(a)| < \varepsilon.

Differentiability. We say ff is differentiable at aa if the limit

f′(a):=lim⁡x→af(x)−f(a)x−af'(a) := \lim_{x \to a} \frac{f(x) - f(a)}{x - a}

exists as a finite real number. This limit, when it exists, is called the derivative of ff at aa. Both definitions require ff to be defined on a full open interval around aa (or at least on a set having aa as a limit point from both sides, in the two-sided sense used here), so that the relevant limits make sense.

Intuition

Picture the graph of ff near the point (a,f(a))(a, f(a)). Differentiability says that as you zoom in around this point, the graph looks more and more like a straight line of slope f′(a)f'(a) — the tangent line. If the graph looked like a straight line locally, it certainly could not have a sudden jump there: a line has no jumps, and "looking more and more like a line" should squeeze out any jump in the limit. Algebraically, the entire proof is contained in one identity. For x≠ax \neq a,

f(x)−f(a)=f(x)−f(a)x−a⏟→ f′(a)⋅(x−a)⏟→ 0.f(x) - f(a) = \underbrace{\frac{f(x) - f(a)}{x - a}}_{\to\, f'(a)} \cdot \underbrace{(x - a)}_{\to\, 0}.

The first factor converges to a finite number f′(a)f'(a) because ff is differentiable at aa; the second factor converges to 00 trivially. A convergent (hence bounded near aa) quantity times a quantity going to zero must itself go to zero. That is exactly the statement that f(x)→f(a)f(x) \to f(a), i.e., continuity. The picture below shows why boundedness of the difference quotient is the crux: as x→ax \to a, the secant slopes settle down to a finite number f′(a)f'(a), so the "rise" f(x)−f(a)f(x)-f(a) cannot help but shrink to 00 as the "run" (x−a)(x-a) shrinks to 00, at the fixed finite rate f′(a)f'(a).

Figure
Secant slopes converging to a finite tangent slope force f(x)→f(a)f(x)\to f(a)
x y a, f(a) a x₁ x₂ x₃ tangent, slope f′(a) secants x₁,x₂,x₃ → a; slopes → f′(a) (finite) ⇒ f(x)−f(a) → 0

Central theorem

TheoremDifferentiability implies continuity

Let ff be a real-valued function defined on an open interval II containing the point aa. If ff is differentiable at aa, then ff is continuous at aa.

Proof

Technique: direct computation with limit laws (algebraic manipulation of the difference quotient, then the product rule for limits). Assume ff is differentiable at aa; that is, the limit

f′(a)=lim⁡x→af(x)−f(a)x−af'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}

exists and is a finite real number.

Step 1 (Algebraic identity). For every x∈Ix \in I with x≠ax \neq a, since x−a≠0x - a \neq 0 we may write

f(x)−f(a)=f(x)−f(a)x−a⋅(x−a).f(x) - f(a) = \frac{f(x) - f(a)}{x - a} \cdot (x - a).

This is a valid algebraic identity for all such xx: we have simply multiplied and divided by the nonzero quantity x−ax - a.

Step 2 (Take the limit as x→ax \to a of both sides). The right-hand side is a product of two functions of xx (both defined for x≠ax \neq a in II):

g(x):=f(x)−f(a)x−a,h(x):=x−a.g(x) := \frac{f(x)-f(a)}{x-a}, \qquad h(x) := x - a.

By hypothesis,

lim⁡x→ag(x)=f′(a),\lim_{x \to a} g(x) = f'(a),

a finite real number. Trivially,

lim⁡x→ah(x)=lim⁡x→a(x−a)=0,\lim_{x \to a} h(x) = \lim_{x\to a}(x - a) = 0,

since this is a linear function of xx vanishing at x=ax=a. By the product rule for limits (if lim⁡x→ag(x)\lim_{x\to a} g(x) and lim⁡x→ah(x)\lim_{x\to a} h(x) both exist, then lim⁡x→ag(x)h(x)\lim_{x\to a} g(x)h(x) exists and equals the product of the limits — a standard fact about limits of real functions, proved directly from the ε\varepsilon–δ\delta definition of limit and not dependent on differentiability or continuity of ff), we conclude

lim⁡x→a[g(x)h(x)]=f′(a)⋅0=0.\lim_{x \to a} \big[g(x) h(x)\big] = f'(a) \cdot 0 = 0.

Step 3 (Conclude). By Step 1, g(x)h(x)=f(x)−f(a)g(x)h(x) = f(x) - f(a) for all x≠ax \neq a in II, so

lim⁡x→a[f(x)−f(a)]=lim⁡x→a[g(x)h(x)]=0.\lim_{x \to a} \big[f(x) - f(a)\big] = \lim_{x\to a} \big[g(x)h(x)\big] = 0.

By linearity of limits (again a basic limit law, independent of the present theorem),

lim⁡x→af(x)−f(a)=0⟹lim⁡x→af(x)=f(a).\lim_{x \to a} f(x) - f(a) = 0 \quad\Longrightarrow\quad \lim_{x\to a} f(x) = f(a).

This is precisely the statement that ff is continuous at aa. No step used continuity of ff at aa as an assumption, nor any theorem whose proof relies on the present one; only the definition of the derivative and the elementary product/sum laws for limits were used. Hence the proof is complete and non-circular. ■\blacksquare

∎
CorollaryContrapositive form

If ff is not continuous at aa, then ff is not differentiable at aa.

Proof

This is the logical contrapositive of the theorem just proved: "P⇒QP \Rightarrow Q" is logically equivalent to "¬Q⇒¬P\lnot Q \Rightarrow \lnot P." Since we proved differentiability at aa ⇒\Rightarrow continuity at aa, discontinuity at aa ⇒\Rightarrow non-differentiability at aa follows immediately, with no further work required. ■\blacksquare

∎

This corollary is often the practically useful direction: it gives an instant proof that certain functions (e.g. the Heaviside step function H(x)=0H(x) = 0 for x<0x<0, H(x)=1H(x)=1 for x≥0x \ge 0) fail to be differentiable at a point of discontinuity, without ever computing a difference quotient.

Worked examples

Example 1: A differentiable function with an asymmetric formula, verified directly. Let f(x)=x3−2x2+5f(x) = x^3 - 2x^2 + 5 and let a=2a = 2. We show directly, from the difference-quotient definition, that ff is differentiable at a=2a=2, and then observe the continuity conclusion falls out for free — the point of the exercise is to see the Step-1 identity in a live, non-symmetric example (not x2x^2, not centered at 00). First compute the difference quotient for x≠2x \neq 2:

f(x)−f(2)x−2=(x3−2x2+5)−(8−8+5)x−2=x3−2x2−5x−2∣check f(2)=5.\frac{f(x)-f(2)}{x-2} = \frac{(x^3 - 2x^2+5) - (8 - 8 + 5)}{x - 2} = \frac{x^3 - 2x^2 - 5}{x-2}\bigg|_{\text{check } f(2)=5}.

Let us recompute f(2)f(2) carefully: f(2)=23−2⋅22+5=8−8+5=5f(2) = 2^3 - 2\cdot 2^2 + 5 = 8 - 8 + 5 = 5. So

f(x)−5x−2=x3−2x2−5+5x−2=x3−2x2x−2=x2(x−2)x−2=x2,x≠2.\frac{f(x) - 5}{x-2} = \frac{x^3 - 2x^2 - 5 + 5}{x - 2} = \frac{x^3 - 2x^2}{x-2} = \frac{x^2(x-2)}{x - 2} = x^2, \quad x \neq 2.

(Here we factored x3−2x2=x2(x−2)x^3 - 2x^2 = x^2(x-2), valid since the polynomial has a root of multiplicity at least 11 at x=2x=2; direct expansion confirms x2(x−2)=x3−2x2x^2(x-2) = x^3-2x^2.) Hence for x≠2x \neq 2, the difference quotient simplifies exactly to x2x^2, and

f′(2)=lim⁡x→2x2=4,f'(2) = \lim_{x \to 2} x^2 = 4,

using continuity of the polynomial x↦x2x \mapsto x^2 (a basic limit fact independent of this theorem). So ff is differentiable at a=2a=2 with f′(2)=4f'(2) = 4. Now apply the theorem: since ff is differentiable at 22, it must be continuous at 22. Indeed, directly,

lim⁡x→2f(x)=lim⁡x→2[(x−2)⋅x2+5]=0⋅4+5=5=f(2),\lim_{x\to 2} f(x) = \lim_{x \to 2}\left[(x-2)\cdot x^2 + 5\right] = 0 \cdot 4 + 5 = 5 = f(2),

confirming continuity — exactly reproducing the mechanism of Step 1–3 of the proof, with g(x)=x2→4=f′(2)g(x) = x^2 \to 4 = f'(2) and h(x)=x−2→0h(x) = x - 2 \to 0, so g(x)h(x)=f(x)−f(2)→0g(x)h(x) = f(x) - f(2) \to 0.

Example 2: Using the contrapositive to rule out differentiability at a jump, for an asymmetric piecewise function. Define

f(x)={x2+1x<13x−1x≥1.f(x) = \begin{cases} x^2 + 1 & x < 1 \\ 3x - 1 & x \ge 1. \end{cases}

We ask: is ff differentiable at a=1a = 1? Check continuity at a=1a=1 first, since the contrapositive corollary tells us this settles the question in one direction. Compute the two one-sided limits:

lim⁡x→1−f(x)=lim⁡x→1−(x2+1)=12+1=2,\lim_{x \to 1^-} f(x) = \lim_{x\to 1^-}(x^2+1) = 1^2+1 = 2,
lim⁡x→1+f(x)=lim⁡x→1+(3x−1)=3(1)−1=2.\lim_{x \to 1^+} f(x) = \lim_{x\to 1^+}(3x-1) = 3(1)-1 = 2.

Both one-sided limits equal 22, and f(1)=3(1)−1=2f(1) = 3(1)-1 = 2 (using the x≥1x\ge1 branch, since 11 falls in that branch). So lim⁡x→1f(x)=2=f(1)\lim_{x\to 1} f(x) = 2 = f(1): ff is continuous at 11. Good — continuity does not rule out differentiability here, so we must check the derivative directly instead of invoking the corollary. Compute one-sided difference quotients at a=1a=1. For x<1x < 1:

f(x)−f(1)x−1=(x2+1)−2x−1=x2−1x−1=(x−1)(x+1)x−1=x+1→1+1=2 as x→1−.\frac{f(x)-f(1)}{x-1} = \frac{(x^2+1) - 2}{x - 1} = \frac{x^2 - 1}{x-1} = \frac{(x-1)(x+1)}{x-1} = x+1 \to 1+1 = 2 \text{ as } x \to 1^-.

For x>1x > 1:

f(x)−f(1)x−1=(3x−1)−2x−1=3x−3x−1=3(x−1)x−1=3→3 as x→1+.\frac{f(x)-f(1)}{x-1} = \frac{(3x-1)-2}{x-1} = \frac{3x-3}{x-1} = \frac{3(x-1)}{x-1} = 3 \to 3 \text{ as } x \to 1^+.

The left-hand derivative is 22 and the right-hand derivative is 33; these disagree, so

lim⁡x→1f(x)−f(1)x−1 does not exist,\lim_{x\to 1}\frac{f(x)-f(1)}{x-1} \text{ does not exist},

and ff is not differentiable at a=1a=1, even though it is continuous there. This is consistent with — but not derivable from — the main theorem: continuity was necessary but not sufficient for differentiability. It illustrates precisely why the converse of the theorem fails, with a genuinely asymmetric (different quadratic vs. linear pieces, non-matching slopes) example.

CounterexampleThe converse fails: continuity does not imply differentiability

The theorem proved above is a one-directional implication. Dropping the hypothesis "differentiable at aa" and asking only for "continuous at aa" is not enough to conclude differentiability — we exhibit the standard sharp counterexample. Let f(x)=∣x∣f(x) = |x| and a=0a = 0.

ff is continuous at 00. For any ε>0\varepsilon > 0, take δ=ε\delta = \varepsilon. If ∣x−0∣<δ|x - 0| < \delta, then ∣f(x)−f(0)∣=∣∣x∣−0∣=∣x∣<δ=ε|f(x) - f(0)| = ||x| - 0| = |x| < \delta = \varepsilon. Hence lim⁡x→0f(x)=0=f(0)\lim_{x\to 0} f(x) = 0 = f(0), so ff is continuous at 00.

ff is not differentiable at 00. Compute the two one-sided limits of the difference quotient at a=0a=0:

lim⁡x→0+f(x)−f(0)x−0=lim⁡x→0+x−0x=lim⁡x→0+1=1,\lim_{x \to 0^+} \frac{f(x)-f(0)}{x - 0} = \lim_{x\to 0^+} \frac{x - 0}{x} = \lim_{x \to 0^+} 1 = 1,
lim⁡x→0−f(x)−f(0)x−0=lim⁡x→0−−x−0x=lim⁡x→0−(−1)=−1.\lim_{x \to 0^-} \frac{f(x)-f(0)}{x-0} = \lim_{x\to 0^-} \frac{-x - 0}{x} = \lim_{x\to 0^-}(-1) = -1.

Since the left-hand limit (−1-1) and right-hand limit (11) of the difference quotient disagree, the two-sided limit

lim⁡x→0f(x)−f(0)x−0\lim_{x\to 0} \frac{f(x)-f(0)}{x-0}

does not exist. Hence ff is not differentiable at a=0a = 0. This shows continuity at a point is strictly weaker than differentiability at that point: f(x)=∣x∣f(x)=|x| satisfies the conclusion of continuity while violating the hypothesis-conclusion pair "differentiable ⇒\Rightarrow continuous" is not reversible. Geometrically, the graph of ∣x∣|x| has a sharp corner at the origin — it is unbroken (continuous) but has no single well-defined tangent line there, only two different one-sided tangent rays of slopes −1-1 and 11. (For an even more extreme separation, the Weierstrass function is continuous everywhere on R\mathbb{R} but differentiable nowhere, showing the gap between the two classes can be maximal, not just a single isolated point.)

Figure
The corner of y=∣x∣y=|x|: continuous but not differentiable at x=0x=0
x y 0 (0, 0) slope −1 slope +1 f(x) = |x| left- and right-hand derivatives at 0 disagree (−1 ≠ 1): no tangent line, though the graph has no gap.

Scope, edge cases & common traps

SituationDifferentiable at aa?Continuous at aa?Notes
f(x)=x3−2x2+5f(x) = x^3-2x^2+5 at a=2a=2Yes (f′(2)=4f'(2)=4)YesOrdinary smooth case; theorem applies directly.
Piecewise quadratic/linear match at a=1a=1 (Example 2)No (one-sided derivatives 2≠32 \ne 3)YesContinuity holds but is not enough for differentiability.
f(x)=∣x∣f(x)=\lvert x\rvert at a=0a=0NoYesThe canonical corner counterexample.
Heaviside step HH at a=0a=0NoNoDiscontinuous, so non-differentiable follows instantly from the contrapositive corollary.
Weierstrass function on R\mathbb{R}NowhereEverywhereExtreme case: continuity everywhere, differentiability nowhere.
ff differentiable only from one side at aa (e.g. domain [a,∞)[a,\infty))One-sided derivative may existOne-sided continuity holdsThe theorem adapts verbatim to one-sided derivatives and one-sided continuity, with the same proof restricted to x→a+x \to a^+ or x→a−x\to a^-.

The mathematician behind it

Origins · 1 minAugustin-Louis Cauchy and how this was discovered
AC
Augustin-Louis Cauchy
1789–1857 · Early 19th-century France, foundational rigor in analysis

Cauchy was among the first to insist on precise limit-based definitions for continuity and the derivative, replacing looser 18th-century infinitesimal reasoning. His Cours d'Analyse (1821) and subsequent lecture notes on the differential calculus established the difference-quotient definition of the derivative essentially as used today, making an argument like the one above — continuity as a consequence of a rigorously defined derivative — possible to state and prove cleanly for the first time. Karl Weierstrass later sharpened Cauchy's framework into the fully modern ε\varepsilon-δ\delta language, and it was Weierstrass who, in 1872, constructed the celebrated continuous-but-nowhere-differentiable function that shows just how wide the gap between continuity and differentiability can be.

History
- 1821 — Cauchy's Cours d'Analyse gives a rigorous limit-based treatment of continuity for functions of a real variable.
- 1823 — Cauchy's Résumé des leçons defines the derivative via the limit of the difference quotient, the definition used in the proof above.
- 1861 — Weierstrass's Berlin lectures formalize the ε\varepsilon-δ\delta definitions of limit, continuity, and differentiability in the modern style.
- 1872 — Weierstrass presents to the Berlin Academy a function continuous everywhere but differentiable nowhere, sharply separating the two classes.
- Late 19th century — the theorem "differentiable implies continuous" becomes a standard early proposition in rigorous calculus textbooks, cementing the modern differentiability-within-continuity hierarchy.
Does this theorem say differentiable functions are "smoother" than continuous functions in every sense?

Yes, in the specific technical sense of admitting a well-defined tangent line, but the hierarchy goes further. Differentiability is one step up from continuity; being continuously differentiable (C1C^1, i.e. f′f' itself continuous) is another step up; having derivatives of all orders (C∞C^\infty) is higher still; and being analytic (equal to its Taylor series locally) is the strongest common smoothness notion. Each containment in this chain is proper: there exist continuous non-differentiable functions, differentiable functions whose derivative is discontinuous, and C∞C^\infty functions that are not analytic (like e−1/x2e^{-1/x^2} near 00). This article establishes only the first, most basic link in that chain.

Is there a version of this theorem for functions of several variables?

Yes, with an important subtlety. If a function f:Rn→Rf:\mathbb{R}^n \to \mathbb{R} is (totally) differentiable at a point aa — meaning it admits a good linear approximation there in the sense of the multivariable derivative (a linear map Df(a)Df(a) satisfying the appropriate limit condition) — then ff is continuous at aa, by essentially the same argument. The subtlety is that merely having all partial derivatives exist at a point is weaker than total differentiability and does not imply continuity; there are functions with all partials existing at a point but failing to be continuous there. The version of the theorem that generalizes cleanly is about the full (Fréchet) derivative, not partial derivatives alone.

Can a function be differentiable at exactly one point and nowhere else?

Yes. A standard example is f(x)=x2⋅1Q(x)f(x) = x^2 \cdot \mathbb{1}_{\mathbb{Q}}(x) (equal to x2x^2 at rational xx and 00 at irrational xx), which can be shown to be differentiable only at x=0x=0 and discontinuous everywhere else. This is consistent with the theorem: at x=0x=0 the function is both differentiable and continuous, while at every other point it fails to be continuous, hence (by the contrapositive corollary) also fails to be differentiable there. It illustrates that the theorem is a purely local, pointwise statement, not a global one.

Why does the proof require the derivative to be a finite real number?

Because the entire argument hinges on the difference quotient g(x)=f(x)−f(a)x−ag(x) = \frac{f(x)-f(a)}{x-a} converging to a specific finite value f′(a)f'(a), so that g(x)g(x) is bounded near aa (a convergent real sequence or function is always eventually bounded). If instead g(x)→+∞g(x) \to +\infty or −∞-\infty (a "vertical tangent," as with f(x)=x1/3f(x) = x^{1/3} at x=0x=0), the product-of-limits step breaks down entirely, since ∞⋅0\infty \cdot 0 is not a determinate limit form. Such functions can still be continuous at the point in question, but they are not differentiable there by the definition used here, since the limit defining f′(a)f'(a) does not exist as a finite number.

Does one-sided differentiability also imply one-sided continuity?

Yes, and the proof is a direct restriction of the two-sided argument to x→a+x \to a^+ (or x→a−x \to a^-). If the right-hand derivative lim⁡x→a+f(x)−f(a)x−a\lim_{x\to a^+}\frac{f(x)-f(a)}{x-a} exists finitely, the same product-of-limits argument (restricted to x>ax>a) shows lim⁡x→a+f(x)=f(a)\lim_{x\to a^+} f(x) = f(a), i.e. right-continuity at aa. This is exactly how Example 2 above is best organized: check one-sided continuity, and if needed, one-sided differentiability, using the one-sided analogue of this theorem.

Is f(x)=∣x∣f(x)=|x| the "smallest" possible counterexample, or are there simpler ones?

∣x∣|x| at x=0x=0 is generally considered the canonical minimal counterexample because it is piecewise linear (about as simple a non-smooth function as exists), manifestly continuous by a trivial ε\varepsilon-δ\delta argument, and its failure of differentiability is transparent geometrically (a visible corner) and algebraically (one-sided derivative limits ±1\pm 1). Simpler-looking examples, like a discontinuous function such as the Heaviside step, fail continuity too, so they do not isolate the phenomenon "continuous but not differentiable" — they conflate both failures at once. ∣x∣|x| isolates exactly one failure, which is why it is the standard teaching example.

Before this

Where this leads