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
Draw a graph without lifting your pen. That’s continuity, in plain English. No jumps, no holes, no shooting off to infinity — the curve just keeps going. 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 ML.
To say it precisely, we use limits: at a point a, the curve has to arrive
exactly at the value the function takes there. One equation hides three
demands: f(a) must exist, the limit as x → a must exist, and the two numbers
must agree. Miss any one and you have a discontinuity — and GATE’s favourite
flavour of this question hands you a piecewise function and asks you to solve
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 single line silently demands all three conditions: f(a) exists, the
two-sided limit exists, and they are equal. f is continuous on an interval
if it is continuous at every point of that interval.
Kinds of discontinuity
- 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. - 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).
- Infinite — the function blows up near
a(a vertical asymptote), e.g.1/xatx = 0.
Matching a piecewise function
When f is defined by 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 give the same value at a. That 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 with an unknown constant
k (or a), with the demand “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, solved
by equating the pieces there. Other variants ask you to classify a discontinuity
or 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 — i.e. 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.
Quick check
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.