Continuity
A function is continuous at a point when its limit there exists and equals the function value — no jump, no hole, no asymptote. A recurring GATE DA piecewise question.
What you'll learn
- Continuity at a: lim_{x→a} f(x) must exist AND equal f(a)
- Continuity on an interval, and matching the pieces of a piecewise function at a seam
- Classifying discontinuities: removable hole, jump, and infinite
- Solving for a parameter that makes a piecewise function continuous (a real 2024 question)
Before you start
The last lesson promised a name for the easy, well-behaved case: a curve that flows straight through its point, with no hole and no jump. Here it is, in the plainest English there is — the graph you can draw without lifting your pen off the paper. No jumps, no holes, no shooting off to infinity; the curve just keeps going.
That unbroken quality is continuity, and it is the property a loss function needs before
gradient descent can trust it — a jump or a hole is exactly where an optimiser stumbles,
which is why continuity quietly underpins most of machine learning. To pin the idea down, we
lean on the limit machinery from the last three lessons. At a point a, the curve must
arrive at exactly the value the function takes there: the value it approaches and the
value it actually holds have to be one and the same number.
That single demand secretly bundles three. f(a) must exist, the limit as x → a must
exist, and the two must agree. Miss any one of the three and you have a discontinuity — and
GATE’s favourite version of this question hands you a piecewise function and asks for the
constant that makes the pieces meet.
Continuity at a point
f is continuous at a when:
lim f(x) = f(a)
x→a
This one line silently demands all three conditions at once: f(a) exists, the two-sided
limit exists, and they are equal. Stretch the idea across a whole stretch of the axis and
f is continuous on an interval when it is continuous at every point of that interval.
Kinds of discontinuity
When the three conditions fail, they fail in one of three recognisable ways:
- Removable (a hole) — the two-sided limit exists, but
f(a)is missing or set to a different value. You could “fill the hole” and fix it in one stroke. - Jump — the left-hand and right-hand limits both exist but disagree, so the two-sided
limit does not exist (the right-hand picture above). No single
f(a)can repair it. - Infinite — the function blows up near
a(a vertical asymptote), as1/xdoes atx = 0.
Matching a piecewise function
Now the case GATE actually tests. When f is built from different formulas on either side of
a point a, continuity at that seam forces the pieces to meet: the left formula and the
right formula must hand back the same value at a. That single equality is usually the whole
question — set the two expressions equal at the seam and solve for the unknown constant.
How GATE asks this
The classic format is MCQ or NAT: a piecewise function carrying an unknown constant k
(or a), with the instruction “find k so that f is continuous.” You write the
seam-matching equation — left piece at a equals right piece at a — and solve.
GATE DA 2024 posed exactly this: a two-piece function joined at a point, cracked by
equating the pieces there. Other variants ask you instead to classify a discontinuity, or
to pick which point breaks continuity.
Worked example — solve for the constant (GATE DA 2024 style)
Find the constant
kthat makes the following continuous atx = 2:
f(x) = x + 1forx ≤ 2, andf(x) = k·xforx > 2.
Continuity at the seam x = 2 needs the limit from the right to match the value from the
left — that is, the two pieces must agree at x = 2:
left piece at 2 : f(2) = 2 + 1 = 3
right limit at 2: lim_{x→2⁺} k·x = k·2 = 2k
match: 2 + 1 = k · 2 → 3 = 2k → k = 3/2 = 1.5
So k = 1.5. With that value both pieces hit 3 at x = 2, the graph connects, and f is
continuous there. Any other k leaves a jump — and the guess you locked in tells you whether
your instinct for the seam was already sound.
A question to carry forward
Continuity buys you a curve with no breaks — you can trace it without lifting the pen. But
recall the V-shape |x| from two lessons back: you can draw that without lifting the pen
too, so it is perfectly continuous, and yet it carries a sharp corner at x = 0 where the
slope can’t decide between −1 and +1. So “no break” plainly is not the end of the story
about smoothness. Here is the thread onward: is there a stronger kind of well-behavedness
that forbids corners as well as breaks — one that pins down a single, definite slope at every
point?
In one breath
- Continuous at
ameanslim_{x→a} f(x) = f(a)— one line bundling three demands:f(a)exists, the limit exists, and the two are equal. - Continuous on an interval = continuous at every point of it; in plain terms, drawable without lifting the pen.
- Three discontinuities: removable (hole — limit fine, value wrong/missing), jump
(one-sided limits disagree), infinite (blows up, like
1/xat0). - Piecewise seam: set the left and right formulas equal at
aand solve for the constant — GATE DA 2024 was exactly this (x+1 = kxat2⇒k = 1.5). - The trap: a limit existing is not enough — it must also equal
f(a).
Practice
Quick check
Practice this in an interview
All questionsThe theorem proves that a single-hidden-layer network with enough neurons and a non-linear activation can approximate any continuous function on a compact domain to arbitrary precision. It guarantees existence, not learnability — it says nothing about how many neurons are needed, whether gradient descent will find the solution, or how the network will generalize.
Gaps-and-islands is the problem of identifying contiguous ranges (islands) within ordered sequential data and the breaks (gaps) between them. The classic solution subtracts a dense sequential integer from the ordering column — equal differences belong to the same island.