← SciSim / Mathematics

Continuity & Discontinuities

Where a function "joins up" — and the four ways it can fail to.
🎓 Tier: HSC → Standard Undergraduate (with rigorous ε-δ option)

📊 Section 1 — Interactive Simulation

Pick a function and a point a. The simulation classifies the discontinuity (if any) by checking three numbers: the left limit, the right limit, and $f(a)$. Drag to pan; pinch / wheel to zoom.

f(x) plot
f(a)
—
left limit f(a−)
—
right limit f(a+)
—
jump |f(a+)−f(a−)|
—
limit exists?
—
continuous at a?
—
classification
—

Animation

Function Preset

Parameters

Display Options

Tips

• The simulation evaluates the function on a punctured neighbourhood of a from both sides and compares to $f(a)$.
• Try sliding a through a discontinuity — watch the classification badge flip.
• In ε-δ Continuity mode the test is $\abs{f(x)-f(a)}<\eps$ (no puncture — the value at $a$ matters here).

🌱 Section 2 — The Idea, Step by Step

From an everyday "unbroken road" picture up to the full $\forall\eps\,\exists\delta$ statement — one gentle climb, then three things to try in the simulation above.

Start — the unbroken-road picture

Picture driving along a road whose shape traces the graph of a function. Where the road runs smoothly under your wheels — no gap to fall into, no sudden step up or down, no ramp that shoots off to the sky — the function is continuous there. A discontinuity is any spot you'd have to jump, drop, or teleport across to keep going. There are exactly four ways a road can break: a single missing paving stone you could just drop back in (removable), a kerb where the surface steps to a new height (jump), a ramp that rockets upward without end (infinite), and a stretch that shudders up and down too fast to ever settle (essential).

Build — the three numbers that decide it

To test continuity at a point $a$ you only ever compare three numbers: the value the graph approaches from the left, $f(a^-)$; the value it approaches from the right, $f(a^+)$; and the value actually plotted at the point, $f(a)$. The function is continuous at $a$ exactly when all three agree. Miss on any one and you have a discontinuity.

One concrete case: take $f(x)=\dfrac{x^2-1}{x-1}$ at $a=1$. Cancel the common factor — $f(x)=\dfrac{(x-1)(x+1)}{x-1}=x+1$ for every $x\neq 1$ — so both sides approach $f(1^-)=f(1^+)=2$. But $f(1)$ itself is $0/0$, undefined. Two of the three numbers agree, the third is simply missing, so the graph has a single removable hole at the point $(1,2)$. Fill it by declaring $f(1):=2$ and the road is whole again.

Deepen — the precise statement and the sliders

The rigorous version drops the talk of roads: $f$ is continuous at $a$ iff $\forall\,\eps>0\ \exists\,\delta>0$ such that $\abs{x-a}<\delta \Rightarrow \abs{f(x)-f(a)}<\eps$. Unlike a limit there is no puncture — the point $x=a$ is included, because here the value at $a$ is precisely what the nearby values must match. In the simulation the $a$ slider chooses the test point, the $\eps$ slider sets the height of the band you demand the output stay within, and the $\delta$ slider sets the width of the window around $a$. The readouts report $f(a^-)$, $f(a^+)$, $f(a)$ and the jump size, while the classification badge flips between continuous, removable, jump, infinite, and essential as you slide.

Try this in the sim above

① Choose f(x) = x² and drag the point $a$ across the screen. The badge stays green Continuous everywhere, because the left value, the right value, and $f(a)$ always coincide — a smooth, unbroken road.

② Choose f(x) = sign(x) at $a=0$. The left limit is $-1$, the right limit is $+1$, so the jump readout reads $2$ and the badge turns red Jump. Shrink $\delta$ as small as you like — the window still straddles the step, so it can never be patched.

③ Choose f(x) = sin(1/(x−0.5)) at $a=0.5$ and zoom in with the wheel. The curve never settles, the one-sided limits "oscillate," and you get the pink Essential badge — the one kind of break you can never fill in.

📐 Section 3 — Definition & Classification Theorem

Three equivalent definitions of continuity, the symbol table, the classification of discontinuities, a proof, and a worked example.

Definition · Continuity at a Point

$f : D \subseteq \R \to \R$ is continuous at $a \in D$ iff any (equivalently, all) of the following hold:

(C1) Limit form: $\displaystyle\lim_{x \to a} f(x) = f(a).$

(C2) ε-δ form: $\forall\,\eps>0\ \exists\,\delta>0:\ \abs{x-a}<\delta\ \Longrightarrow\ \abs{f(x)-f(a)}<\eps.$

(C3) Heine form (sequential): $\forall\{x_n\}\subset D,\ x_n\to a\ \Longrightarrow\ f(x_n)\to f(a).$

Note: in (C2) the puncture $0<\abs{x-a}$ is dropped — for continuity, $x=a$ is included (and trivially passes).

Symbol Table

SymbolMeaningType / Domain
$f$ The function under study $D \to \R$
$D$ Domain Subset of $\R$, must contain $a$
$a$ Point of interest Real, $a \in D$
$f(a^-)$ Left limit $\lim_{x\to a^-}f(x)$ Real or $\pm\infty$ or DNE
$f(a^+)$ Right limit $\lim_{x\to a^+}f(x)$ Real or $\pm\infty$ or DNE
$\eps,\delta$Output / input tolerances Both $>0$, $\delta=\delta(\eps)$
$\omega(\delta)$Modulus of continuity $\sup\{\abs{f(x)-f(a)}:\abs{x-a}<\delta\}$Non-decreasing in $\delta$

Classification of Discontinuities

Suppose $f$ is not continuous at $a$. Examine $f(a^-),\, f(a^+),\, f(a)$:

Both one-sided limits exist and are finite
… and equal each other (= $L$): Removable   — either $f(a)\neq L$ or $a\notin D$. "Patch" by redefining $f(a):=L$.
… but unequal: Jump   — jump magnitude $= \abs{f(a^+)-f(a^-)}$.
At least one one-sided limit is $\pm\infty$: Infinite   — vertical asymptote at $a$.
At least one one-sided limit fails to exist (oscillates): Essential   — e.g. $\sin(1/x)$ at $0$.
Removable + jump together are called discontinuities of the first kind; the rest are second kind.

Proof — (C1) ⇔ (C3)

Step 1 · Setup
We prove: $\lim_{x\to a}f(x)=f(a)$  ⇔  for every sequence $x_n\to a$ in $D$, $f(x_n)\to f(a)$.
Step 2 · (⇒) direction
Assume (C1). Let $x_n\to a$ and $\eps>0$. By (C2) (equivalent to C1), pick $\delta>0$ with $\abs{x-a}<\delta\Rightarrow\abs{f(x)-f(a)}<\eps$. Since $x_n\to a$, choose $N$ so $n\geq N\Rightarrow\abs{x_n-a}<\delta$. Then $n\geq N\Rightarrow\abs{f(x_n)-f(a)}<\eps$. Hence $f(x_n)\to f(a)$.
Step 3 · (⇐) direction by contrapositive
Suppose (C2) fails: there is $\eps_0>0$ such that for every $\delta>0$ some $x$ with $\abs{x-a}<\delta$ satisfies $\abs{f(x)-f(a)}\geq\eps_0$.
Step 4 · Build a witness sequence
For each $n\in\N$, take $\delta=1/n$ and pick $x_n$ with $\abs{x_n-a}<1/n$ and $\abs{f(x_n)-f(a)}\geq\eps_0$.
Step 5 · Convergence of $x_n$
Since $\abs{x_n-a}<1/n\to 0$, we have $x_n\to a$. So $\{x_n\}$ is a sequence converging to $a$ in $D$.
Step 6 · Failure of $f(x_n)\to f(a)$
For all $n$, $\abs{f(x_n)-f(a)}\geq\eps_0>0$. So $f(x_n)\not\to f(a)$.
Step 7 · Conclusion
The contrapositive says: if (C3) holds, then (C2) holds, i.e. (C1). Combined with Step 2, $\boxed{(C1)\Leftrightarrow(C3).}$

Simulation ↔ Symbol Mapping

slider a point $a$ being tested for continuity
slider ε output tolerance $\eps$ (vertical band around $f(a)$)
slider δ input radius $\delta$ around $a$ (horizontal strip — not punctured)
readout f(a−) $\displaystyle\lim_{h\to 0^+}f(a-h)$, computed by sampling $h\in\{0.5,0.25,\ldots,10^{-9}\}$
readout f(a+) $\displaystyle\lim_{h\to 0^+}f(a+h)$, same scheme
readout jump $\abs{f(a^+)-f(a^-)}$; zero ⇒ left=right ⇒ candidate for continuity or removable
readout continuous at a?true iff both one-sided limits equal $f(a)$, all finite
readout classification continuous / removable / jump / infinite / essential — by the tree above
graph ω(δ) modulus of continuity — vanishes at 0 iff $f$ continuous at $a$

Worked Example — Classify and Patch

Let $\displaystyle f(x)=\frac{x^2-1}{x-1}$. Is $f$ continuous at $a=1$? If not, classify and (if possible) patch.

Domain: $f$ is undefined at $x=1$ (division by zero), so $a=1\notin D$. Already, $f$ cannot be continuous there in the strict sense — there's no $f(1)$.

Compute one-sided limits: for $x\neq 1$, $f(x)=\dfrac{(x-1)(x+1)}{x-1}=x+1$. So $f(1^-)=f(1^+)=2$.

Classification: both one-sided limits equal $L=2$, finite. Either way (whether $f(1)$ is undefined or unequal to $2$), this is a Removable discontinuity.

Patch: define $\tilde{f}(1):=2$. Then $\tilde{f}$ agrees with $f$ everywhere $f$ is defined and is continuous at $1$. $\boxed{\tilde{f}(x) = x+1.}$

Reference: Spivak, M. — Calculus, 4th ed., Ch. 6 "Continuous Functions"; Rudin, W. — Principles of Mathematical Analysis, 3rd ed., §4.5 "Continuity"; Abbott, S. — Understanding Analysis, 2nd ed., §4.3 "Continuous Functions".

❓ Section 4 — Frequently Asked Questions

Real questions Bangladeshi students ask about continuity. Tap to expand.

🧮Conceptual If I can draw the graph "without lifting my pen," is the function continuous?▶

That intuition works for elementary functions on intervals but fails badly elsewhere. The Weierstrass function is continuous everywhere yet differentiable nowhere — drawing it requires infinite zoom-in detail; you can't physically draw it, but it is continuous. Conversely, a function defined on $\mathbb{Q}$ alone may be "continuous" in the formal sense even though its graph is a dust of disconnected points. The pen-lifting picture is a good warm-up, not a definition.

Key takeaway: continuity is a local ε-δ property — the pen test is a heuristic, not a definition.
🔬Simulation What exactly does the simulation compute when it labels a point "removable" vs "jump"?▶

It samples $f$ at $a-h$ and $a+h$ for $h \in \{0.5, 0.25, \ldots, 10^{-9}\}$ to estimate the one-sided limits $f(a^-), f(a^+)$. It checks: (i) do these stabilize to finite values? (ii) do they agree? (iii) does that common value equal $f(a)$? If both stabilize and agree but differ from $f(a)$ (or $f(a)$ is undefined), it's removable. If they stabilize but disagree, it's jump. If one or both grow without bound, it's infinite. If they refuse to stabilize at all (the values keep oscillating as $h$ shrinks), it's essential.

Key takeaway: classification = (do limits exist?) + (are they equal?) + (do they match $f(a)$?).
🌍Applied Where do discontinuities show up in physics, engineering, or programming?▶

Step inputs in control systems (the unit-step / Heaviside function $H(t)$) are jump discontinuities — they drive the entire study of impulse response and convolution. Phase transitions in physics (water boiling, magnetization) appear as jump discontinuities of order parameters as a function of temperature. In programming, every if/else branch creates a piecewise function; if the branches don't agree at the boundary, you have a numerical discontinuity that can wreck optimization (gradient descent loses meaning at jumps). Shock waves in fluid dynamics are propagating jump discontinuities of pressure and density.

Key takeaway: every "switch", "phase change", or "shock" in nature or code is a jump discontinuity.
💡Non-Obvious Can a function be continuous everywhere except at $\Q$ (the rationals)?▶

Yes — this is Thomae's function. Define $f(x)=1/q$ if $x=p/q$ in lowest terms with $q>0$, and $f(x)=0$ if $x$ is irrational, $f(0)=0$. Astonishingly, $f$ is continuous at every irrational and discontinuous at every rational. The reason: near any irrational $a$, all rationals with small denominator are far away, so $f$ values near $a$ are tiny — matching $f(a)=0$. By contrast, near any rational $p/q$, irrationals (where $f=0$) are dense, so $f$ keeps jumping back to $0$ while $f(p/q)=1/q\neq 0$. There is no function continuous on the rationals and discontinuous on the irrationals (a Baire-category result).

Key takeaway: the set of discontinuities of any function is always an $F_\sigma$ set — that's a deep restriction.
📐Computational How does the simulation numerically decide a limit "exists"?▶

It samples a geometric sequence $h_k = h_0 \cdot 2^{-k}$ for $k=0,1,\ldots,K$ (typically $K=30$, so $h$ shrinks from $0.5$ to $\approx 5\times 10^{-10}$). It computes $y_k = f(a\pm h_k)$ and checks whether $|y_K - y_{K-1}| < \tau$ for tolerance $\tau \approx 10^{-7}$. Cost: $O(K)$ function evaluations per side. Failure modes: (1) for $\sin(1/(x-a))$, $y_k$ oscillates without converging — flagged as "essential". (2) For $1/(x-a)^2$, $y_k$ grows like $4^k$ — flagged as "infinite" once $|y_k|$ exceeds $10^{12}$. (3) For Lipschitz $f$ near $a$, convergence is geometric so 30 steps is overkill — but cheap.

Key takeaway: numerical limits = "does $y_k$ stabilize as $h_k \to 0$ geometrically?" — $O(\log_2(1/\tau))$ work.
🎓Deep / Advanced Why is continuity of $f$ equivalent to "preimages of open sets are open"?▶

This is the topological definition. Re-read (C2): $\abs{x-a}<\delta \Rightarrow \abs{f(x)-f(a)}<\eps$ says the preimage of $(f(a)-\eps,f(a)+\eps)$ contains $(a-\delta,a+\delta)$, an open interval around $a$. So for every open ball around $f(a)$, the preimage is open. Generalizing: $f$ is continuous on $D$ iff for every open set $U\subseteq\R$, $f^{-1}(U)$ is open in $D$. This works in arbitrary topological spaces — no metric needed. It also gives clean proofs: composition of continuous functions is continuous (preimage of open is open, applied twice), and continuous image of compact is compact (a topological one-liner).

Key takeaway: continuity is the morphism of topological spaces — ε-δ is just the metric expression of "preimage of open is open".
🧮Conceptual What's the difference between "continuous at $a$" and "continuous on $[a,b]$"?▶

"Continuous at $a$" is a local statement about one point. "Continuous on $[a,b]$" means continuous at every point of the interval (with one-sided continuity at the endpoints). The latter unlocks the heavy machinery: the Extreme Value Theorem (max/min attained), Intermediate Value Theorem (every value in between is hit), and uniform continuity (one $\delta$ works for the whole interval, not a different $\delta$ per point). On open intervals or on $\R$, continuity gives less — pointwise continuity does not imply uniform continuity (think of $f(x)=1/x$ on $(0,1)$).

Key takeaway: "continuous on a closed bounded interval" is what calculus's big theorems actually need.
Best explanatory resource: 3Blue1Brown — "Limits, continuity, and Weierstrass" (Essence of Calculus); Paul's Online Math Notes — "Continuity" (https://tutorial.math.lamar.edu/Classes/CalcI/Continuity.aspx); MIT OCW 18.100A — Real Analysis, Lecture 5 (continuous functions); Better Explained — Kalid Azad, "Why do we need continuity?" (https://betterexplained.com).

⚠️ Section 5 — Misconceptions & Common Errors

Three conceptual misconceptions about continuity, plus three procedural errors.

A · Conceptual Misconceptions
❌ Misconception: "Continuous means smooth — no corners, no kinks." ✅ Correction: Continuity and smoothness are different. $f(x)=\abs{x}$ is continuous everywhere but has a corner at $0$ (not differentiable there). $f(x)=x^{1/3}$ is continuous on $\R$ but has a vertical tangent at $0$. Continuity says "no jumps"; differentiability says "no corners or vertical tangents". Differentiable ⇒ continuous, but the converse is dramatically false (Weierstrass function: continuous everywhere, differentiable nowhere). 📖 Reference: Spivak — Calculus, 4th ed., Ch. 6 §"Continuous Functions"; Ch. 9 §"Derivatives" (note the implication direction).
❌ Misconception: "If a limit exists at $a$, then $f$ is continuous at $a$." ✅ Correction: Continuity needs three things together: (i) $f(a)$ is defined, (ii) $\lim_{x\to a}f(x)$ exists, (iii) the two are equal. A removable discontinuity is the case where (ii) holds but (i) or (iii) fails. Example: $f(x)=(x^2-4)/(x-2)$ has $\lim_{x\to 2}f(x)=4$, but $f(2)$ is undefined — limit exists, $f$ is not continuous at $2$. 📖 Reference: Rudin — Principles of Mathematical Analysis, 3rd ed., Definition 4.5.
❌ Misconception: "$f+g$ continuous and $f$ continuous implies $g$ continuous." ✅ Correction: True in this direction (subtract: $g=(f+g)-f$, sum/difference of continuous is continuous). But the parallel claim "if $fg$ continuous and $f$ continuous, then $g$ continuous" is false. Counterexample: $f(x)=0$ (continuous) and $g(x)=\sgn(x)$ (discontinuous at 0). Then $fg=0$ is continuous, but $g$ is not. The trap: dividing by $f$ requires $f\neq 0$. 📖 Reference: Abbott — Understanding Analysis, 2nd ed., Theorem 4.3.4 (algebraic combinations).
B · Common Procedural Errors
❌ Error: "$f(x)=\dfrac{x^2-1}{x-1}$, so $f(1)=\dfrac{0}{0}$ is undefined, therefore $\lim_{x\to 1}f(x)$ does not exist." ✅ Correct work: Factor first: $f(x)=\dfrac{(x-1)(x+1)}{x-1}=x+1$ for $x\neq 1$. So $\lim_{x\to 1}f(x)=\lim_{x\to 1}(x+1)=2$. The limit exists and equals $2$; $f$ has a removable discontinuity. Justifying rule: limits ignore the value at $a$ (punctured neighbourhood — see Topic 1). 🔍 Why students do this: they conflate "$f$ undefined at $a$" with "limit DNE", forgetting that limits look at neighbours of $a$, not $a$ itself.
❌ Error: "For $f(x)=\sgn(x)$ at $a=0$: $f(0)=0$, $\lim_{x\to 0}f(x)=0$ (just plug in), so continuous." ✅ Correct work: "Plugging in" is invalid — that assumes continuity, which is what we're testing. Compute one-sided: $\lim_{x\to 0^-}\sgn(x)=-1$, $\lim_{x\to 0^+}\sgn(x)=+1$. These differ, so the two-sided limit does not exist; $f$ has a jump discontinuity at $0$, not continuous. Justifying rule: $\lim_{x\to a}f$ exists iff $\lim_{x\to a^-}f=\lim_{x\to a^+}f$, both finite. 🔍 Why students do this: they short-circuit by reading off $f(0)=0$ and assume the limit must equal it — circular reasoning.
❌ Error: "If $f$ is continuous on $(0,1]$ and $\lim_{x\to 0^+}f(x)$ exists, then $f$ is continuous on $[0,1]$." ✅ Correct work: Continuity on $[0,1]$ requires $f(0)$ to be defined and equal the right limit. As stated, $f(0)$ is not given. Correct statement: if we extend $f$ by setting $f(0)=\lim_{x\to 0^+}f(x)$, then the extension is continuous on $[0,1]$. The original $f$ may have $f(0)$ undefined or unequal to the limit. Justifying rule: continuity at $a$ requires $f(a)=\lim_{x\to a}f(x)$, both sides existing. 🔍 Why students do this: they conflate "the limit equals something" with "the function value equals that something" — but the function might not even have a value there.
Education research: Tall, D. & Vinner, S. — "Concept image and concept definition in mathematics", Educational Studies in Mathematics 12(2), 151–169 (1981) — documents the "pen-lifting" image displacing the formal definition; Sierpinska, A. — Understanding in Mathematics, Falmer Press (1994), Ch. 4 on continuity epistemology; Bezuidenhout, J. — "First-year university students' understanding of rate of change and continuity", IJMEST 29(3), 389–399 (1998); Núñez, R., Edwards, L. & Matos, J. — "Embodied cognition as grounding for situatedness and context in mathematics education", ESM 39(1–3), 45–65 (1999).