Exercises — Functions, limits, and continuity
Before we start, one shared picture of the whole toolkit — refer back to it whenever you feel lost.

Level 1 — Recognition
You only need to read a definition or a graph and answer "yes / no / which type".
Exercise L1.1 — Is it a function?
For each rule, decide whether is a function of : (a) (b) (c) (d) .
Recall Solution L1.1
The test is the vertical line test: draw any vertical line ; if it hits the curve more than once, one input gave two outputs → not a function.
- (a) : a straight line, every vertical line hits once → ✅ function.
- (b) : solve for , get . Input gives and → ❌ not a function.
- (c) : each gives exactly one non-negative output → ✅ function.
- (d) is a circle; gives → ❌ not a function.
Exercise L1.2 — Name the discontinuity
Match each function to removable, jump, or infinite discontinuity at the marked point: (a) at (b) at (c) the step at .
Recall Solution L1.2
- (a) As the output blows up to → infinite discontinuity.
- (b) Factor: for . Limit is but is undefined () → removable (a hole at ).
- (c) Left limit , right limit ; they disagree → jump.
Level 2 — Application
Plug the definitions in and compute.
Exercise L2.1 — Removable-hole limits
Compute: (a) (b) .
Recall Solution L2.1
(a) Plugging in gives → simplify. Factor the top: . Why legal: the limit never touches , so and we may cancel. Now .
(b) Plugging in gives again, but there's no factor to cancel — the fix is to rationalize (multiply by the conjugate to kill the square-root difference): Why this tool: the conjugate turns into a plain difference , which cancels the troublesome in the denominator. Now substitute: .
Exercise L2.2 — One-sided limits of a step
Let . Find , , and state whether exists.
Recall Solution L2.2
- From the left (): .
- From the right (): .
- Left () right () → the two-sided limit does not exist. This is a jump discontinuity of size .
Level 3 — Analysis
Reason about why, not just compute.
Exercise L3.1 — Prove a limit from the definition
Using –, prove . Explicitly give the .
Recall Solution L3.1
Goal: for any tolerance on the output, find a closeness on the input so that .
Step 1 — rewrite the output-gap using the input-gap. Why: controls , so we want the output-gap expressed in that quantity. Step 2 — demand it be : . Step 3 — choose . Then . ✅ The limit is genuinely , built from the definition rather than guessed.
Exercise L3.2 — Continuity with a parameter
Find the value of that makes continuous at :
Recall Solution L3.2
Continuity at needs . Compute the limit (it's , so simplify): for , so . Set . We just plugged the hole with the limit value — condition 3 (heading arrival) now holds.
Level 4 — Synthesis
Combine limits, continuity, and the indeterminate-form toolkit — including L'Hôpital's Rule.
Exercise L4.1 — Choosing the right tool
Evaluate two ways: (i) intuitively via the small-angle picture, (ii) via L'Hôpital's Rule. State why each is valid.
Recall Solution L4.1
Form check: at , → indeterminate, so we may not just substitute.
(i) Small-angle picture (see figure): for a tiny angle (in radians), the arc length and the vertical nearly coincide, so and the ratio .
(ii) L'Hôpital — why valid: the form is and both and are differentiable near , which are exactly L'Hôpital's preconditions. Differentiate top and bottom separately: Both routes agree: the limit is .

Exercise L4.2 — Continuity of a composite (backprop backbone)
Let (the sigmoid) and . Is the composite continuous at every real ? Justify with the composite-continuity rule, then evaluate it at .
Recall Solution L4.2
Rule (Continuity of composite functions): if is continuous at and is continuous at , then is continuous at .
- is a polynomial → continuous everywhere.
- : the denominator is always (an exponential is never negative), so we never divide by zero → is continuous everywhere.
- Compose: continuous continuous is continuous for all real . This chaining is exactly why a stack of continuous layers in a network stays continuous — the backbone of backprop.
At : .
Level 5 — Mastery
Full reasoning across the whole chapter, tied to the ML payoff.
Exercise L5.1 — ReLU: continuous but not differentiable
Consider (see Activation functions (ReLU, sigmoid)). (a) Show it is continuous at using the three conditions. (b) Show it is not differentiable at by comparing the two one-sided slopes. (c) In one sentence, explain why gradient descent still works with ReLU.
Recall Solution L5.1
(a) Continuity at — check all three:
- → exists.
- Left: for , value . Right: for , value . Both sides head to , so → exists.
- Limit → heading arrival. ✅ Continuous.
(b) Differentiability at — the derivative is the limit of the slope .
- From the left (): → slope .
- From the right (): → slope . Left slope right slope → no unique tangent, so not differentiable at . Geometrically, a corner (see figure).
(c) At the single kink we pick any value in (a subgradient, commonly ); everywhere else ReLU is perfectly smooth, so descent has usable slopes almost everywhere and trains fine.

Exercise L5.2 — Design a loss with no cliffs
A student proposes a loss . (a) Is continuous at ? (b) If not, redefine one piece minimally so that it becomes continuous, keeping the branch fixed. (c) Why does the original break gradient descent?
Recall Solution L5.2
(a) Left limit: . Right value/limit: . Since , there is a jump of size → not continuous at . (b) To glue the arrival at , the right branch must approach the same from the right. Replace the constant: use for (drop the ), giving right limit left limit → continuous. (Any right branch with limit at works; is the minimal edit.) (c) A jump is a vertical cliff: near the "slope" is infinite/undefined, so the descent ball can't roll across smoothly — steps overshoot or diverge. Gradient descent needs the loss continuous (and mostly differentiable) so slopes are finite and meaningful — see Gradient Descent and Derivatives and gradients.
Recap ladder
Recall One-line takeaway per level
L1 Recognition — vertical line test & discontinuity types by inspection. L2 Application — kill by factoring / rationalizing; check both sides for jumps. L3 Analysis — prove limits with ; patch holes with the limit value. L4 Synthesis — pick the right tool (L'Hôpital only for ); compose continuity. L5 Mastery — continuous ⇏ differentiable; jumps (not kinks) break descent.
Self-check clozes:
The tool that removes a difference in a limit is the conjugate (rationalize).
L'Hôpital's Rule is licensed only for the forms
ReLU at is continuous but
To make continuous you set equal to
Connections
- Derivatives and gradients — L5 uses one-sided slopes; the derivative IS a limit.
- Gradient Descent — L5.2 shows why jumps break the rolling ball.
- Activation functions (ReLU, sigmoid) — L4.2 and L5.1 are the sigmoid/ReLU cases.
- L'Hôpital's Rule — the L4 tool for .
- Continuity of composite functions — L4.2's composite rule.