# Limits and Continuity: Reading ε-δ as a Contract on Error

> Dirichlet's function shows why 'approaches indefinitely' is no definition. From ε-δ alone we prove uniqueness, the algebra of limits, squeezing, continuity and uniform continuity.
> https://rikai.mugen-giken.com/en/mathematics/calculus/limits-and-continuity

## 0. Key points

- "As $x$ approaches $a$ indefinitely, $f(x)$ approaches $L$ indefinitely" is a metaphor that contains motion. As it stands, its truth cannot be decided. The ε-δ formulation rewrites it as a static condition: whatever accuracy is demanded of us, we can return a range that guarantees it.
- The skeleton of the definition is the order of the quantifiers $\forall \varepsilon\ \exists \delta\ \forall x$. Here $\delta$ may depend on $\varepsilon$, never the other way round. This one-way street settles every feature of the definition.
- Uniqueness of limits, the algebra of limits and the squeeze theorem can all be proved from this definition alone. The proofs follow a single pattern: split the demanded $\varepsilon$ and hand out the pieces.
- Continuity means that the limit as $x \to a$ exists and, in addition, that its value equals $f(a)$. Dirichlet's function is discontinuous at every point, Thomae's function is continuous exactly at the irrationals — examples beyond the reach of intuition, yet decided mechanically once we follow the definition.
- Moving one quantifier produces a different notion, uniform continuity. The function $f(x) = 1/x$ is continuous on $(0,1]$ but not uniformly continuous there.

## 1. Motivation: where "approaches indefinitely" is vague

"As $x$ approaches $a$ indefinitely, $f(x)$ approaches $L$ indefinitely." This explanation, the one found in high-school textbooks, works well in many situations. Nobody doubts that bringing $x$ close to $1$ in $f(x) = 2x+1$ brings $f(x)$ close to $3$. Even so, we cannot adopt the sentence as it stands as a mathematical definition. There are three reasons.

**First, "approaches" is a word about motion.** The $x$ that appears in mathematics does not change. It is a single point on the real line, not a particle moving with time. Reading "approaches" literally would drag in the extra notion of time.

**Second, the degree of "indefinitely" cannot be measured.** When we say that $f(x)$ is close to $L$, how close must it be? Within $0.1$? Within $10^{-100}$? Calling something close without fixing a standard does not let us decide whether a given assertion is true or false, and a sentence whose truth cannot be decided is not a definition.

**Third, functions on which intuition fails really do exist.** Consider the following function, Dirichlet's function.

$$
D(x) = \begin{cases} 1 & (x \in \mathbb{Q}) \\ 0 & (x \notin \mathbb{Q}) \end{cases}
$$

Let us bring $x$ "indefinitely close" to $0$. Approaching along $x = 1/n$, the value $D(x)$ is $1$ the whole way; approaching along $x = \sqrt{2}/n$, it is $0$ the whole way. The answer changes with the manner of approach, and the naive phrasing falls silent. Moreover the values of $D$ do not "jump" between $1$ and $0$: inside every interval, however narrow, both values keep occurring. Drawing the graph and looking at it is not an option either.

Historically, too, this vagueness did real damage. Analysis in the eighteenth century used "infinitesimals" freely — quantities that are not $0$ yet smaller than every positive number — and thereby obtained a great many formulas, but it also put false claims into circulation, such as the assertion that the sum of a series of continuous functions is continuous. The confusion was settled when Cauchy placed limits at the foundation of analysis in his *Cours d'analyse* (1821), and Weierstrass and his school completed the formulation in terms of $\varepsilon$ and $\delta$ in the second half of the nineteenth century. The question of why $0.999\cdots = 1$ is correct as an equality has the same root ([What is a number?](/en/mathematics/foundations/what-is-a-number)).

The practical gain from making limits rigorous is plain. The derivative is itself the limit $\lim_{h \to 0} \dfrac{f(a+h)-f(a)}{h}$ ([The definition of the derivative and basic differentiation](/en/mathematics/calculus/derivatives)), and the sum of an infinite series is defined as the limit of the sequence of partial sums ([Series and convergence tests](/mathematics/calculus/series-and-convergence)). If the foundation is vague, every theorem built on it is vague as well.

The change of viewpoint is this. We stop speaking of the process of approaching and speak only of **accuracy achieved**. "$f(x)$ is close to $L$" is reread as "the error is less than $\varepsilon$", and the range of $x$ permitted in order to guarantee that is reread as "the distance from $a$ is less than $\delta$". Everything then reduces to a single question: can we fill every order for accuracy?

## 2. Preliminaries: neighborhoods, accumulation points, notation

Throughout, $\mathbb{N} = \{1, 2, 3, \ldots\}$ (we do not include $0$), $\mathbb{Q}$ is the set of rational numbers and $\mathbb{R}$ the set of real numbers. The symbol $|x|$ denotes the absolute value, and $|x - y|$ the distance between $x$ and $y$ on the number line. The two inequalities we shall use again and again are these.

$$
|x + y| \le |x| + |y|, \qquad \bigl| |x| - |y| \bigr| \le |x - y|
$$

The first (the triangle inequality) follows once we add $\pm x \le |x|$ and $\pm y \le |y|$ to obtain $\pm(x+y) \le |x|+|y|$. For the second, $|x| = |(x-y)+y| \le |x-y| + |y|$ gives $|x|-|y| \le |x-y|$, and interchanging $x$ and $y$ gives $|y|-|x| \le |x-y|$; combining the two yields the claim.

We take as given the handling of the quantifiers $\forall$ (for all) and $\exists$ (there exists), together with their negations, as treated in [The grammar of mathematics: sets and logic](/en/mathematics/foundations/sets-and-logic).

<Definition id="def-neighborhood" title="Neighborhoods, punctured neighborhoods, accumulation points">
For $a \in \mathbb{R}$ and $\delta > 0$, the sets

$$
U_\delta(a) = \{\, x \in \mathbb{R} : |x - a| < \delta \,\}, \qquad
U_\delta^{*}(a) = \{\, x \in \mathbb{R} : 0 < |x - a| < \delta \,\}
$$

are called the **$\delta$-neighborhood** and the **punctured $\delta$-neighborhood** of $a$, respectively. Thus $U_\delta(a)$ equals the open interval $(a-\delta,\ a+\delta)$, and $U^{*}_\delta(a)$ is that set with the single point $a$ removed.

Further, for $A \subseteq \mathbb{R}$ and $a \in \mathbb{R}$, if

$$
\forall \delta > 0,\quad U^{*}_\delta(a) \cap A \ne \emptyset
$$

holds, then $a$ is called an **accumulation point** of $A$.
</Definition>

Being an accumulation point means that arbitrarily close to $a$ there are points of $A$ different from $a$ itself. For instance, the set of accumulation points of $A = (0,1)$ is $[0,1]$ (the endpoints $0$ and $1$ do not belong to $A$, yet they are accumulation points). By contrast, $0$ is not an accumulation point of $A = \{0\} \cup (1,2)$, since taking $\delta = 1$ gives $U^{*}_1(0) \cap A = \emptyset$. Such a point is called an **isolated point**.

The accumulation-point condition is the minimal hypothesis under which limits can be discussed at all. If there are no points of $A$ near $a$, there is no material with which to speak of "the value $f(x)$ as $x$ is brought close to $a$". In <Ref to="thm-uniqueness" /> we shall see what breaks if this hypothesis is dropped.

## 3. The ε-δ definition of a limit

<Definition id="def-limit" title="Limit of a function">
Let $A \subseteq \mathbb{R}$, let $f : A \to \mathbb{R}$, and let $a$ be an accumulation point of $A$ (<Ref to="def-neighborhood" />). If a real number $L$ satisfies

$$
\forall \varepsilon > 0,\ \exists \delta > 0,\ \forall x \in A, \quad
0 < |x - a| < \delta \implies |f(x) - L| < \varepsilon
$$

then $f$ is said to **converge** to $L$ as $x \to a$, and we write

$$
\lim_{x \to a} f(x) = L
$$

The notation $f(x) \to L\ (x \to a)$ carries the same meaning.
</Definition>

Read this formula as an exchange between two players. The opponent places the order for accuracy; we are the ones who must fill it.

<Figure caption="Reading ε-δ as a contract on error. What is essential is the order: ε is given first, and δ is chosen afterwards">
<Mermaid code={`flowchart LR
  A["Move 1: the opponent specifies an accuracy ε > 0"] --> B["Move 2: we produce a single δ > 0"]
  B --> C["Move 3: the opponent freely picks a point x within distance δ of a (a itself excluded)"]
  C --> D["Verdict: if f(x) is within ε of L for every such x, the contract is met"]`} />
</Figure>

We have $\lim_{x\to a} f(x) = L$ exactly when we can win, that is, when we can respond to every $\varepsilon$. What is decisive here is **the order of play**. The value $\varepsilon$ is given first and $\delta$ is chosen afterwards; hence $\delta$ may depend on $\varepsilon$, and in practice one usually has to take $\delta$ smaller as $\varepsilon$ gets smaller. Conversely $x$ is chosen after $\delta$, so $\delta$ is not permitted to depend on $x$.

In a picture, $\varepsilon$ determines a horizontal band (the permitted spread of values) and $\delta$ a vertical band (the permitted spread of $x$).

<Figure caption="The horizontal band (the tolerance ε on values) is given first, and the vertical band (the width δ around a, with a itself excluded) is chosen to match. Every x in the vertical band must be carried into the horizontal band">
<svg viewBox="0 0 640 380" width="100%" role="img" aria-label="Figure showing the relation between the ε band and the δ band">
  <rect x="70" y="150" width="520" height="80" fill="currentColor" fill-opacity="0.06" />
  <rect x="250" y="150" width="100" height="80" fill="var(--sl-color-accent)" fill-opacity="0.18" />
  <line x1="70" y1="345" x2="610" y2="345" stroke="currentColor" stroke-width="1.2" />
  <line x1="70" y1="35" x2="70" y2="345" stroke="currentColor" stroke-width="1.2" />
  <line x1="70" y1="150" x2="590" y2="150" stroke="currentColor" stroke-width="1" stroke-dasharray="5 4" />
  <line x1="70" y1="230" x2="590" y2="230" stroke="currentColor" stroke-width="1" stroke-dasharray="5 4" />
  <line x1="70" y1="190" x2="590" y2="190" stroke="currentColor" stroke-width="1" stroke-dasharray="2 5" />
  <line x1="250" y1="60" x2="250" y2="345" stroke="var(--sl-color-accent)" stroke-width="1" stroke-dasharray="5 4" />
  <line x1="350" y1="60" x2="350" y2="345" stroke="var(--sl-color-accent)" stroke-width="1" stroke-dasharray="5 4" />
  <line x1="300" y1="60" x2="300" y2="345" stroke="currentColor" stroke-width="1" stroke-dasharray="2 5" />
  <path d="M 90 300 C 190 265, 245 225, 300 190 S 470 125, 590 92" fill="none" stroke="var(--sl-color-accent)" stroke-width="2.4" />
  <circle cx="300" cy="190" r="4" fill="var(--sl-color-accent)" />
  <text x="60" y="155" text-anchor="end" font-size="13" fill="currentColor">L + ε</text>
  <text x="60" y="195" text-anchor="end" font-size="13" fill="currentColor">L</text>
  <text x="60" y="235" text-anchor="end" font-size="13" fill="currentColor">L − ε</text>
  <text x="250" y="366" text-anchor="middle" font-size="13" fill="currentColor">a − δ</text>
  <text x="300" y="366" text-anchor="middle" font-size="13" fill="currentColor">a</text>
  <text x="350" y="366" text-anchor="middle" font-size="13" fill="currentColor">a + δ</text>
  <text x="612" y="341" font-size="13" fill="currentColor">x</text>
  <text x="80" y="143" font-size="13" fill="currentColor">ε band</text>
  <text x="300" y="52" text-anchor="middle" font-size="13" fill="currentColor">δ band</text>
  <text x="496" y="112" font-size="13" fill="currentColor">y = f(x)</text>
</svg>
</Figure>

<Aside type="tip">
With $\delta$, finding one is already a win. If some $\delta$ satisfies the condition, then every $\delta'$ with $0 < \delta' \le \delta$ satisfies it automatically (because $0 < |x-a| < \delta'$ implies $0 < |x-a| < \delta$). So there is no need to make $\delta$ best possible; we may always shrink it further. This is the property at work whenever a proof takes the minimum of several requirements, as in $\delta = \min(1,\ \varepsilon/5)$.
</Aside>

<Remark id="rem-negation" title="Negating the definition">
The negation of <Ref to="def-limit" />, that is, the statement that $L$ is **not** the limit of $f$ as $x \to a$, is obtained by reversing the quantifiers in turn and using the negation of an implication, $\lnot(P \implies Q) \equiv P \wedge \lnot Q$:

$$
\exists \varepsilon_0 > 0,\ \forall \delta > 0,\ \exists x \in A, \quad
0 < |x - a| < \delta \ \wedge\ |f(x) - L| \ge \varepsilon_0
$$

In words: there is an accuracy $\varepsilon_0$ such that, however small $\delta$ is taken, a point with error at least $\varepsilon_0$ remains inside the punctured $\delta$-neighborhood of $a$. Saying that $f$ has no limit as $x \to a$ then means that this holds for **every** $L \in \mathbb{R}$. When showing that a limit fails to exist, this is the form we aim at.
</Remark>

### 3.1. Proving directly from the definition

<Example id="ex-affine" title="Limit of a linear function">
Let us show that $\lim_{x \to 1} f(x) = 3$ for $f(x) = 2x + 1$ (with $A = \mathbb{R}$).

**Scratch work (how to find $\delta$).** The inequality we must guarantee is $|f(x) - 3| < \varepsilon$. Computing the left-hand side,

$$
|f(x) - 3| = |(2x+1) - 3| = |2x - 2| = 2|x - 1|
$$

so it is enough to have $2|x-1| < \varepsilon$, that is, $|x - 1| < \varepsilon/2$. This suggests taking $\delta = \varepsilon/2$.

**Proof.** Let $\varepsilon > 0$ be arbitrary and put $\delta = \varepsilon/2 > 0$. For every $x \in \mathbb{R}$ with $0 < |x - 1| < \delta$, the computation above gives

$$
|f(x) - 3| = 2|x - 1| < 2\delta = 2 \cdot \frac{\varepsilon}{2} = \varepsilon
$$

Since $\varepsilon$ was arbitrary, <Ref to="def-limit" /> gives $\lim_{x\to1}(2x+1) = 3$.

The scratch work traces the inequalities backwards; it is not the proof itself. When writing the proof, keep to the order: receive $\varepsilon$, declare $\delta$, then chain the inequalities forwards.
</Example>

<Example id="ex-square" title="Limit of a quadratic function: choosing δ in two stages">
Let us show that $\lim_{x \to 2} g(x) = 4$ for $g(x) = x^2$.

**Scratch work.** We have $|x^2 - 4| = |x - 2|\,|x + 2|$. The factor $|x-2|$ can be made small by $\delta$, but $|x+2|$ remains. So we decide in advance to work only in the range $|x-2| < 1$. There $1 < x < 3$, hence

$$
|x + 2| = x + 2 < 5
$$

and we may use $|x^2 - 4| < 5|x-2|$. It then suffices to impose $5|x-2| < \varepsilon$, that is, $|x-2| < \varepsilon/5$. To meet both requirements at once we take the minimum, so we set $\delta = \min(1,\ \varepsilon/5)$.

**Proof.** Let $\varepsilon > 0$ be arbitrary and put $\delta = \min\left(1,\ \dfrac{\varepsilon}{5}\right) > 0$. Suppose $0 < |x - 2| < \delta$. First, $|x - 2| < 1$ gives $1 < x < 3$, hence $|x+2| = x + 2 < 5$. Second, we also have $|x-2| < \varepsilon/5$, so

$$
|x^2 - 4| = |x-2|\,|x+2| < \frac{\varepsilon}{5} \cdot 5 = \varepsilon .
$$

Therefore $\lim_{x\to2} x^2 = 4$.

Note that $\delta$ may depend not only on $\varepsilon$ but also on the point $a$ being approached. Carrying out the same computation for a general $a$ yields $\delta = \min(1,\ \varepsilon/(2|a|+1))$, so the larger $|a|$ is, the smaller $\delta$ must be taken. This dependence becomes the theme of §6.
</Example>

<Theorem id="thm-uniqueness" title="Uniqueness of limits">
Let $A \subseteq \mathbb{R}$, let $f : A \to \mathbb{R}$, and let $a$ be an accumulation point of $A$. If $\lim_{x\to a} f(x) = L$ and $\lim_{x \to a} f(x) = M$, then $L = M$.
</Theorem>

<Proof of="thm-uniqueness">
We assume $L \ne M$ and derive a contradiction (a proof by contradiction; on the shapes of such arguments see [Techniques of proof: induction and contradiction](/en/mathematics/foundations/proof-techniques)).

Put $\varepsilon = \dfrac{|L - M|}{2}$. From $L \ne M$ we get $|L-M| > 0$, hence $\varepsilon > 0$.

Applying <Ref to="def-limit" /> to $L$, there is $\delta_1 > 0$ such that $x \in A$ and $0 < |x-a| < \delta_1$ imply $|f(x) - L| < \varepsilon$. Applying it likewise to $M$, there is $\delta_2 > 0$ such that $x \in A$ and $0 < |x-a| < \delta_2$ imply $|f(x) - M| < \varepsilon$.

Put $\delta = \min(\delta_1, \delta_2) > 0$. Since $a$ is an accumulation point of $A$ by hypothesis, <Ref to="def-neighborhood" /> gives $U^{*}_{\delta}(a) \cap A \ne \emptyset$, and we may pick a point $x_0$ from this set. This $x_0$ satisfies both $0 < |x_0 - a| < \delta \le \delta_1$ and $0 < |x_0-a| < \delta \le \delta_2$, so both conclusions above apply and

$$
|L - M| = |(L - f(x_0)) + (f(x_0) - M)| \le |f(x_0) - L| + |f(x_0) - M| < \varepsilon + \varepsilon = |L - M|
$$

(the first inequality is the triangle inequality of §2). This says $|L-M| < |L-M|$, a contradiction. Hence $L = M$.
</Proof>

In the proof, the hypothesis that $a$ is an accumulation point was used only in order to produce the point $x_0$. Drop it and the conclusion falls with it. Indeed, take $A = \{0\} \cup (1,2)$ and $a = 0$ (an isolated point of $A$), and let $f$ be an arbitrary function on $A$. For $\delta = 1$ there is no $x \in A$ with $0 < |x-0| < 1$. The implication in <Ref to="def-limit" /> is then **always true, its antecedent being false**, so every real number $L$ becomes a "limit". Uniqueness fails. Restricting $a$ to accumulation points in the definition is precisely what prevents this degeneracy.

## 4. Building calculation rules from the definition

Going back to $\varepsilon$ and $\delta$ every single time is laborious. Once a few basic limits and calculation rules have been proved, everything afterwards can be assembled from them. We begin by checking that a convergent function does not run wild near $a$.

<Lemma id="lem-local-bounded" title="Convergence implies local boundedness">
Let $A \subseteq \mathbb{R}$, let $g : A \to \mathbb{R}$, let $a$ be an accumulation point of $A$, and suppose $\lim_{x\to a} g(x) = M$. Then there exists $\delta_0 > 0$ such that $|g(x)| < |M| + 1$ for every $x \in U^{*}_{\delta_0}(a) \cap A$.
</Lemma>

<Proof of="lem-local-bounded">
Take $\varepsilon = 1$ in <Ref to="def-limit" /> (since $\varepsilon$ may be any positive number, we may apply the definition to this particular value). Then there is $\delta_0 > 0$ such that $x \in A$ and $0 < |x - a| < \delta_0$ imply $|g(x) - M| < 1$. For such $x$ the triangle inequality (§2) gives

$$
|g(x)| = |(g(x) - M) + M| \le |g(x) - M| + |M| < 1 + |M|
$$

as claimed.
</Proof>

<Theorem id="thm-algebra" title="Algebra of limits">
Let $A \subseteq \mathbb{R}$, let $f, g : A \to \mathbb{R}$, let $a$ be an accumulation point of $A$, and suppose $\lim_{x\to a} f(x) = L$ and $\lim_{x \to a} g(x) = M$. Then the following hold.

1. $\lim_{x\to a} \bigl(f(x) + g(x)\bigr) = L + M$.
2. $\lim_{x\to a} c\,f(x) = cL$ for every constant $c \in \mathbb{R}$.
3. $\lim_{x\to a} f(x)g(x) = LM$.
4. If moreover $M \ne 0$, then there exists $\delta_1 > 0$ such that $g(x) \ne 0$ for $x \in U^{*}_{\delta_1}(a) \cap A$, and the function $f/g$, defined on $B = U^{*}_{\delta_1}(a) \cap A$, satisfies $\lim_{x\to a} \dfrac{f(x)}{g(x)} = \dfrac{L}{M}$.
</Theorem>

<Proof of="thm-algebra">
**(1)** Let $\varepsilon > 0$ be arbitrary. Since $\varepsilon/2 > 0$, apply <Ref to="def-limit" /> to $f$ with $\varepsilon/2$ to get $\delta_1 > 0$, and to $g$ with $\varepsilon/2$ to get $\delta_2 > 0$. Put $\delta = \min(\delta_1,\delta_2) > 0$. For $x \in A$ with $0 < |x-a| < \delta$ both estimates apply, and the triangle inequality (§2) gives

$$
|(f(x)+g(x)) - (L+M)| \le |f(x)-L| + |g(x)-M| < \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon .
$$

**(2)** If $c = 0$, then $|0 - 0| = 0 < \varepsilon$ holds for every $\delta$. If $c \ne 0$, feed $\varepsilon/|c| > 0$ into <Ref to="def-limit" /> for a given $\varepsilon > 0$ to obtain $\delta > 0$; then for $0<|x-a|<\delta$ we get $|cf(x) - cL| = |c|\,|f(x)-L| < |c| \cdot \varepsilon/|c| = \varepsilon$.

**(3)** We split the difference in two. From the identity

$$
f(x)g(x) - LM = g(x)\bigl(f(x)-L\bigr) + L\bigl(g(x)-M\bigr)
$$

(expanding the right-hand side gives $g(x)f(x) - Lg(x) + Lg(x) - LM$, which is the left-hand side) together with the triangle inequality,

$$
|f(x)g(x) - LM| \le |g(x)|\,|f(x)-L| + |L|\,|g(x)-M| .
$$

By <Ref to="lem-local-bounded" /> choose $\delta_0 > 0$ with $|g(x)| < |M|+1$ for $0<|x-a|<\delta_0$. Let $\varepsilon > 0$ be arbitrary, and apply <Ref to="def-limit" /> to $f$ with $\dfrac{\varepsilon}{2(|M|+1)} > 0$ to get $\delta_2$, and to $g$ with $\dfrac{\varepsilon}{2(|L|+1)} > 0$ to get $\delta_3$ (the $+1$ in the denominators is there so that the division is legitimate even when $L = 0$). Putting $\delta = \min(\delta_0,\delta_2,\delta_3)$, for $0 < |x-a| < \delta$ we obtain

$$
|f(x)g(x)-LM| < (|M|+1)\cdot\frac{\varepsilon}{2(|M|+1)} + |L| \cdot \frac{\varepsilon}{2(|L|+1)} \le \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon
$$

(the last inequality uses $|L| \le |L|+1$).

**(4)** First we show that $g$ does not vanish near $a$. Since $M \ne 0$ we have $|M|/2 > 0$, so applying <Ref to="def-limit" /> to $g$ with $\varepsilon = |M|/2$ yields $\delta_1 > 0$. For $x \in B = U^{*}_{\delta_1}(a) \cap A$, the second inequality of §2 gives

$$
|M| - |g(x)| \le |g(x) - M| < \frac{|M|}{2}
\quad\Longrightarrow\quad |g(x)| > \frac{|M|}{2} > 0
$$

and in particular $g(x) \ne 0$. Hence $f/g$ is defined on $B$. Moreover $a$ is an accumulation point of $B$ as well: for any $\delta>0$, since $a$ is an accumulation point of $A$ we have $U^{*}_{\min(\delta,\delta_1)}(a) \cap A \ne \emptyset$, and this set is contained in $U^{*}_\delta(a) \cap B$. We are therefore entitled to speak of the limit.

Now we estimate. For $x \in B$,

$$
\left| \frac{f(x)}{g(x)} - \frac{L}{M} \right|
= \frac{|M f(x) - L g(x)|}{|g(x)|\,|M|}
< \frac{2}{|M|^2}\,\bigl| M(f(x)-L) - L(g(x)-M) \bigr|
\le \frac{2}{|M|^2}\Bigl( |M|\,|f(x)-L| + |L|\,|g(x)-M| \Bigr)
$$

(we used $|g(x)| > |M|/2$ in the denominator, and rewrote the numerator as $Mf(x)-Lg(x) = M(f(x)-L) - L(g(x)-M)$ before applying the triangle inequality). Let $\varepsilon>0$ be arbitrary and apply <Ref to="def-limit" /> to $f$ with $\dfrac{|M|\varepsilon}{4} > 0$ and to $g$ with $\dfrac{|M|^2 \varepsilon}{4(|L|+1)} > 0$, obtaining $\delta_2, \delta_3$. Putting $\delta = \min(\delta_1,\delta_2,\delta_3)$, for $0<|x-a|<\delta$ with $x \in B$ we get

$$
\left| \frac{f(x)}{g(x)} - \frac{L}{M} \right|
< \frac{2}{|M|^2}\left( |M| \cdot \frac{|M|\varepsilon}{4} + |L| \cdot \frac{|M|^2\varepsilon}{4(|L|+1)} \right)
= \frac{\varepsilon}{2} + \frac{|L|}{|L|+1}\cdot\frac{\varepsilon}{2} \le \varepsilon
$$

as required.
</Proof>

<Theorem id="thm-squeeze" title="Squeeze theorem">
Let $A \subseteq \mathbb{R}$, let $f, g, h : A \to \mathbb{R}$, and let $a$ be an accumulation point of $A$. Suppose there is $\delta_0 > 0$ with

$$
x \in U^{*}_{\delta_0}(a) \cap A \implies f(x) \le g(x) \le h(x)
$$

and suppose $\lim_{x\to a} f(x) = \lim_{x \to a} h(x) = L$. Then $\lim_{x\to a} g(x) = L$.
</Theorem>

<Proof of="thm-squeeze">
Let $\varepsilon > 0$ be arbitrary. Applying <Ref to="def-limit" /> to $f$ gives $\delta_1 > 0$, and applying it to $h$ gives $\delta_2 > 0$. Put $\delta = \min(\delta_0, \delta_1, \delta_2) > 0$ and take $x \in A$ with $0 < |x-a| < \delta$.

From $|f(x) - L| < \varepsilon$ we get $L - \varepsilon < f(x)$, and from $|h(x)-L| < \varepsilon$ we get $h(x) < L + \varepsilon$. Also $\delta \le \delta_0$, so the assumed inequality applies and $f(x) \le g(x) \le h(x)$. Chaining these,

$$
L - \varepsilon < f(x) \le g(x) \le h(x) < L + \varepsilon
$$

which gives $-\varepsilon < g(x) - L < \varepsilon$, that is, $|g(x) - L| < \varepsilon$.
</Proof>

<Example id="ex-xsin" title="A function that converges while oscillating">
On $A = \mathbb{R} \setminus \{0\}$ put $g(x) = x \sin\dfrac{1}{x}$. Then $\lim_{x\to0} g(x) = 0$.

For $x \ne 0$ we have $\left|\sin\dfrac1x\right| \le 1$, hence

$$
-|x| \le x \sin\frac{1}{x} \le |x|
$$

The limit $\lim_{x\to0} |x| = 0$ is immediate from the definition (given $\varepsilon>0$, take $\delta = \varepsilon$; then $0<|x-0|<\delta$ gives $\bigl||x| - 0\bigr| = |x| < \varepsilon$). Taking $c = -1$ in part (2) of <Ref to="thm-algebra" /> gives $\lim_{x\to0}(-|x|) = 0$. So <Ref to="thm-squeeze" /> applies with $f(x) = -|x|$, $h(x) = |x|$, $L = 0$ and $\delta_0$ arbitrary (say $1$), and we obtain $\lim_{x\to0} g(x) = 0$.

This function oscillates infinitely often near $0$, yet it converges because the amplitude is crushed down to $0$. Approaching monotonically is not a requirement for convergence. If instead the amplitude is not damped and we consider $\sin\dfrac1x$ itself, the limit does not exist (<Ref to="exr-no-limit" />).
</Example>

<Theorem id="thm-sequential" title="Sequential characterization">
Let $A \subseteq \mathbb{R}$, let $f : A \to \mathbb{R}$, let $a$ be an accumulation point of $A$, and let $L \in \mathbb{R}$. The following two conditions are equivalent.

1. $\lim_{x\to a} f(x) = L$.
2. For every sequence $(x_n)_{n \in \mathbb{N}}$ with $x_n \in A$, $x_n \ne a$ for all $n \in \mathbb{N}$, and $\lim_{n\to\infty} x_n = a$, one has $\lim_{n\to\infty} f(x_n) = L$.

Here convergence of a sequence, $\lim_{n\to\infty} y_n = c$, means "$\forall \varepsilon>0,\ \exists N \in \mathbb{N},\ \forall n \ge N,\ |y_n - c| < \varepsilon$".
</Theorem>

<Proof of="thm-sequential">
**(1) implies (2).** Let $(x_n)$ be a sequence satisfying the stated conditions and let $\varepsilon>0$ be arbitrary. By (1) and <Ref to="def-limit" /> there is $\delta>0$ such that $x\in A$ and $0<|x-a|<\delta$ imply $|f(x)-L|<\varepsilon$. Since $x_n \to a$, using this $\delta$ as the $\varepsilon$ in the definition of convergence of a sequence gives $N \in \mathbb{N}$ such that $n \ge N$ implies $|x_n - a| < \delta$. Furthermore $x_n \ne a$ by hypothesis, that is, $|x_n - a| > 0$. Hence for $n \ge N$ we have $0 < |x_n - a| < \delta$ and therefore $|f(x_n) - L| < \varepsilon$. This says $f(x_n) \to L$.

**(2) implies (1).** We prove the contrapositive. If (1) fails, then by the form in <Ref to="rem-negation" /> there is $\varepsilon_0>0$ such that for **every** $\delta>0$ there exists $x \in A$ with $0<|x-a|<\delta$ and $|f(x)-L| \ge \varepsilon_0$.

For each $n \in \mathbb{N}$ apply this with $\delta = 1/n$ and choose one such $x$, calling it $x_n$. Then $x_n \in A$, $0 < |x_n - a| < 1/n$ and $|f(x_n) - L| \ge \varepsilon_0$.

This sequence satisfies the hypotheses of (2). Indeed $|x_n - a| > 0$ gives $x_n \ne a$, and for $\varepsilon>0$ the Archimedean property provides $N \in \mathbb{N}$ with $1/N < \varepsilon$, so that $n \ge N$ implies $|x_n - a| < 1/n \le 1/N < \varepsilon$; hence $x_n \to a$.

But $|f(x_n) - L| \ge \varepsilon_0$ holds for every $n$, so for this $\varepsilon_0$ no choice of $N$ makes $|f(x_N)-L| < \varepsilon_0$, and $f(x_n) \to L$ fails. Thus (2) fails.
</Proof>

<Ref to="thm-sequential" /> is especially effective for proving that a limit **does not** exist. If we can find two sequences converging to $a$ along which the values of $f$ head for different destinations, that alone lets us conclude that there is no limit.

## 5. Continuity

<Definition id="def-continuity" title="Continuity at a point">
Let $A \subseteq \mathbb{R}$, let $f : A \to \mathbb{R}$ and let $a \in A$. If

$$
\forall \varepsilon>0,\ \exists \delta>0,\ \forall x \in A,\quad |x - a| < \delta \implies |f(x) - f(a)| < \varepsilon
$$

holds, then $f$ is said to be **continuous** at $a$. If $f$ is continuous at every point of $A$, then $f$ is said to be continuous on $A$.
</Definition>

There are only two differences from <Ref to="def-limit" />. First, the target value $L$ is fixed to be $f(a)$. Second, the exclusion $0 < |x-a|$ has been dropped, so $x = a$ is now among the points to be tested. The second change has no substantial effect, because for $x = a$ the inequality $|f(a)-f(a)| = 0 < \varepsilon$ always holds. Consequently, if $a$ is an accumulation point of $A$, then "$f$ is continuous at $a$" and "$\lim_{x\to a} f(x) = f(a)$" are equivalent. If instead $a$ is an isolated point of $A$, we can choose $\delta>0$ with $U_{\delta}(a) \cap A = \{a\}$, and this $\delta$ meets the condition for every $\varepsilon$, so $f$ is automatically continuous at $a$. Continuity is thus a combination of two things, that the limit exists and that its value is $f(a)$; since the value $f(a)$ itself is at stake, it is a notion distinct from that of a limit.

<Corollary id="cor-polynomial" title="Continuity of polynomials and rational functions">
A polynomial function $p(x) = c_0 + c_1 x + \cdots + c_n x^n$ (with $c_k \in \mathbb{R}$) is continuous on $\mathbb{R}$. Moreover, if $p$ and $q$ are polynomials, the rational function $p/q$ is continuous at every point $a$ with $q(a) \ne 0$.
</Corollary>

<Proof of="cor-polynomial">
Fix $a \in \mathbb{R}$. The constant function $x \mapsto c$ is continuous: for any $\varepsilon>0$, take $\delta = 1$; then $|c - c| = 0 < \varepsilon$. The identity function $x \mapsto x$ is continuous: take $\delta = \varepsilon$; then $|x - a| < \delta = \varepsilon$. Since $a$ is an accumulation point of $\mathbb{R}$, the equivalence stated above lets us restate these as $\lim_{x\to a} c = c$ and $\lim_{x\to a} x = a$.

We show $\lim_{x\to a} x^k = a^k$ by induction on $k$. The case $k=1$ was just seen. Assuming it for $k$, apply part (3) of <Ref to="thm-algebra" /> to $f(x)=x^k$ and $g(x)=x$ to obtain $\lim_{x\to a} x^{k+1} = a^k \cdot a = a^{k+1}$. Hence the statement holds for every $k \in \mathbb{N}$.

Next, part (2) of <Ref to="thm-algebra" /> gives $\lim_{x\to a} c_k x^k = c_k a^k$, and applying part (1) $n$ times gives $\lim_{x\to a} p(x) = p(a)$. This is exactly the continuity of $p$ at $a$.

As for rational functions, when $q(a) \ne 0$ we apply part (4) of <Ref to="thm-algebra" /> with $M = q(a) \ne 0$: on some punctured neighborhood of $a$ we have $q \ne 0$ and $\lim_{x\to a} p(x)/q(x) = p(a)/q(a)$. Since $q(a) \ne 0$ at $x=a$ as well, $p/q$ is defined on a neighborhood containing $a$ and is continuous at $a$.
</Proof>

<Theorem id="thm-composition" title="Continuity of a composition">
Let $A, B \subseteq \mathbb{R}$, let $f : A \to \mathbb{R}$ satisfy $f(A) \subseteq B$, and let $g : B \to \mathbb{R}$. If $f$ is continuous at $a \in A$ and $g$ is continuous at $b = f(a) \in B$, then the composition $g \circ f : A \to \mathbb{R}$ is continuous at $a$.
</Theorem>

<Proof of="thm-composition">
Let $\varepsilon>0$ be arbitrary. Since $g$ is continuous at $b$, <Ref to="def-continuity" /> provides $\eta > 0$ such that

$$
y \in B,\ |y - b| < \eta \implies |g(y) - g(b)| < \varepsilon
$$

Next, since $f$ is continuous at $a$, applying <Ref to="def-continuity" /> with this $\eta$ as the "demanded accuracy" provides $\delta>0$ such that

$$
x \in A,\ |x - a| < \delta \implies |f(x) - f(a)| = |f(x) - b| < \eta
$$

Now let $x \in A$ with $|x-a|<\delta$. Then $f(x) \in f(A) \subseteq B$ (by hypothesis) and $|f(x)-b| < \eta$, so the first implication applies with $y = f(x)$ and gives

$$
|g(f(x)) - g(f(a))| < \varepsilon
$$

Hence $g \circ f$ is continuous at $a$.
</Proof>

<Remark id="rem-composition-trap" title="The limit version of composition fails">
It is tempting to restate <Ref to="thm-composition" /> as "if $\lim_{x\to a} f(x) = b$ and $\lim_{y\to b} g(y) = c$, then $\lim_{x\to a} g(f(x)) = c$", but this is **false**. Here is a counterexample. Let $f(x) = 0$ for all $x \in \mathbb{R}$, and let

$$
g(y) = \begin{cases} 1 & (y \ne 0) \\ 0 & (y = 0) \end{cases}
$$

Since $f$ is constant, $\lim_{x\to0} f(x) = 0$. Also $g(y)=1$ for every $y$ with $0 < |y-0| < \delta$, so $\lim_{y\to0} g(y) = 1$. But $g(f(x)) = g(0) = 0$ for every $x$, whence $\lim_{x\to0} g(f(x)) = 0 \ne 1$.

The cause is clear: the definition of a limit excludes $y = b$ from inspection, while $f$ actually attains the value $b$. The definition of continuity does not exclude $x=a$, so it has no such hole. When composing in the language of limits, assume that the outer function $g$ is continuous at $b$.
</Remark>

<Proposition id="prop-dirichlet" title="Dirichlet's function is discontinuous at every point">
For the Dirichlet function $D$ defined in §1, the limit $\lim_{x\to a} D(x)$ fails to exist for every $a \in \mathbb{R}$, and consequently $D$ is not continuous at $a$.
</Proposition>

<Proof of="prop-dirichlet">
We first use the fact that for any real numbers $\alpha < \beta$ the open interval $(\alpha,\beta)$ contains at least one rational and at least one irrational number. Existence of a rational is the density of $\mathbb{Q}$. For an irrational, take a rational $r \in (\alpha,\beta)$ and, by the Archimedean property, an $n \in \mathbb{N}$ with $\sqrt{2}/n < \beta - r$; then $r + \sqrt{2}/n \in (r,\beta) \subseteq (\alpha,\beta)$, and this number is irrational (the sum of a rational and an irrational is irrational: if $r + \sqrt2/n$ were rational, then $\sqrt2 = n\bigl((r+\sqrt2/n) - r\bigr)$ would be rational, contradicting the irrationality of $\sqrt2$).

Now fix $a \in \mathbb{R}$ and suppose some $L \in \mathbb{R}$ satisfies $\lim_{x\to a} D(x) = L$. For $\varepsilon_0 = \dfrac12 > 0$, <Ref to="def-limit" /> provides $\delta>0$ such that $0<|x-a|<\delta$ implies $|D(x)-L| < \dfrac12$.

By what was just shown, the interval $(a,\ a+\delta)$ contains a rational $p$ and an irrational $q$. Both satisfy $a < p < a+\delta$ and $a < q < a+\delta$, hence $0 < |p - a| < \delta$ and $0 < |q-a| < \delta$. Therefore $|D(p)-L|<\dfrac12$ and $|D(q)-L|<\dfrac12$. But $D(p)=1$ and $D(q)=0$, so the triangle inequality (§2) gives

$$
1 = |D(p) - D(q)| \le |D(p)-L| + |L - D(q)| < \frac12 + \frac12 = 1
$$

a contradiction. Hence no such $L$ exists. Since $a$ is an accumulation point of $\mathbb{R}$, continuity of $D$ at $a$ would force $\lim_{x\to a} D(x) = D(a)$, so the limit would exist. Therefore $D$ is not continuous at $a$.
</Proof>

<Example id="ex-thomae" title="Thomae's function: continuous exactly at the irrationals">
Consider the following function $t : \mathbb{R} \to \mathbb{R}$.

$$
t(x) = \begin{cases} \dfrac{1}{q} & \left(x = \dfrac{p}{q},\ p \in \mathbb{Z},\ q \in \mathbb{N},\ \gcd(|p|,q) = 1\right) \\ 0 & (x \notin \mathbb{Q}) \end{cases}
$$

Since the reduced representation of a rational number is unique once the denominator is taken positive, there is no ambiguity in this definition (for instance $t(0) = t(0/1) = 1$, $t(1/2) = 1/2$, $t(2/4) = t(1/2) = 1/2$).

**Claim: $\lim_{x \to a} t(x) = 0$ for every $a \in \mathbb{R}$.**

Let $\varepsilon>0$ be arbitrary. By the Archimedean property there is $N \in \mathbb{N}$ with $\dfrac1N < \varepsilon$. Put

$$
S = \left\{\, x \in (a-1,\ a+1) : x = \frac{p}{q},\ p \in \mathbb{Z},\ q \in \mathbb{N},\ \gcd(|p|,q)=1,\ q \le N \,\right\}
$$

The set $S$ is finite. Indeed, for each $q \in \{1,\ldots,N\}$, an integer $p$ with $p/q \in (a-1,a+1)$ satisfies $q(a-1) < p < q(a+1)$. If there are $m$ integers satisfying this condition, then the difference between the largest and the smallest of them is at least $m-1$; but both lie in an open interval of length $2q$, so that difference is smaller than $2q$, giving $m - 1 < 2q$, that is, $m \le 2q \le 2N$. Since there are $N$ candidate denominators $q$, the set $S$ has at most $2N^2$ elements.

If $S \setminus \{a\}$ is nonempty, put

$$
\delta = \min\Bigl(1,\ \min_{s \in S \setminus \{a\}} |s - a| \Bigr)
$$

The set $S \setminus \{a\}$ is finite and each of its elements $s$ satisfies $s \ne a$, that is, $|s-a|>0$, so $\delta > 0$ as the minimum of finitely many positive numbers (this is where finiteness is doing the work). If $S \setminus \{a\}$ is empty, put $\delta = 1$.

Suppose $0 < |x - a| < \delta$. Since $\delta \le 1$ we have $x \in (a-1,a+1)$.

- If $x$ is irrational, then $|t(x) - 0| = 0 < \varepsilon$.
- If $x$ is rational with reduced representation $p/q$, then $x \ne a$ and $|x-a| < \delta$, so by the choice of $\delta$ we have $x \notin S \setminus \{a\}$ and hence $x \notin S$. But $x \in (a-1,a+1)$, so by the definition of $S$ it cannot be that $q \le N$. Therefore $q > N$ and $|t(x)-0| = \dfrac1q < \dfrac1N < \varepsilon$.

In both cases $|t(x) - 0| < \varepsilon$, so <Ref to="def-limit" /> gives $\lim_{x\to a} t(x) = 0$, proving the claim.

**Consequence.** If $a$ is irrational, then $t(a) = 0 = \lim_{x\to a} t(x)$, so by the equivalence at the start of §5 the function $t$ is continuous at $a$. If $a$ is rational with reduced representation $p/q$, then $t(a) = 1/q > 0 \ne 0 = \lim_{x\to a}t(x)$, so $t$ is discontinuous at $a$. That is, $t$ is continuous exactly at the irrationals.

Because the rationals are scattered densely among the irrationals, the behavior of this function cannot be captured by a picture. Even so, <Ref to="def-limit" /> constructs an explicit $\delta$ for each $\varepsilon$ and settles the matter completely. This is where the practical value of ε-δ arguments lies.
</Example>

## 6. The order of quantifiers once more: uniform continuity

As we saw in <Ref to="ex-square" />, the $\delta$ in the definition of continuity may depend not only on $\varepsilon$ but also on the point $a$. Demanding that a $\delta$ can be chosen independently of $a$ produces a different notion.

<Definition id="def-uniform-continuity" title="Uniform continuity">
Let $A \subseteq \mathbb{R}$ and $f : A \to \mathbb{R}$. If

$$
\forall \varepsilon>0,\ \exists \delta>0,\ \forall x \in A,\ \forall y \in A,\quad |x - y| < \delta \implies |f(x)-f(y)| < \varepsilon
$$

holds, then $f$ is said to be **uniformly continuous** on $A$.
</Definition>

The two notions differ only in the position of a quantifier.

| Notion | Skeleton of the formula | What $\delta$ may depend on |
|---|---|---|
| Continuous at each point of $A$ | $\forall \varepsilon\ \forall a \in A\ \exists \delta\ \forall x \in A$ | $\varepsilon$ and $a$ |
| Uniformly continuous on $A$ | $\forall \varepsilon\ \exists \delta\ \forall a \in A\ \forall x \in A$ | $\varepsilon$ only |

The only difference is whether $\exists \delta$ stands to the left or to the right of $\forall a$. By definition, uniform continuity implies continuity at each point (just use the uniform $\delta$ at each point). The converse fails.

<Example id="ex-not-uniform" title="A continuous function that is not uniformly continuous">
On $A = (0,1]$ put $f(x) = \dfrac1x$.

**Continuity.** The functions $x \mapsto 1$ and $x \mapsto x$ are polynomials, so by <Ref to="cor-polynomial" /> the function $f = 1/x$ is continuous at every point with $x \ne 0$; in particular at every point of $A$.

**Failure of uniform continuity.** The negation of <Ref to="def-uniform-continuity" /> reads: there is $\varepsilon_0>0$ such that for every $\delta>0$ there exist $x, y \in A$ with $|x-y|<\delta$ and $|f(x)-f(y)| \ge \varepsilon_0$. Take $\varepsilon_0 = 1$. Let $\delta>0$ be arbitrary, use the Archimedean property to choose $n \in \mathbb{N}$ with $\dfrac1n < \delta$, and put

$$
x = \frac{1}{2n},\qquad y = \frac1n
$$

Since $n \ge 1$ we have $x, y \in (0,1]$. Then

$$
|x - y| = \left|\frac{1}{2n} - \frac1n\right| = \frac{1}{2n} < \frac1n < \delta,
\qquad
|f(x) - f(y)| = |2n - n| = n \ge 1 = \varepsilon_0
$$

Hence no $\delta$ satisfies the condition, and $f$ is not uniformly continuous on $(0,1]$.

Intuitively, the graph becomes steeper the closer we get to $0$, so the $\delta$ needed to respect a fixed $\varepsilon$ becomes arbitrarily small. A finite $\delta$ can be chosen at each individual point, but these $\delta$'s have no positive lower bound.
</Example>

<Remark id="rem-heine-cantor" title="On a closed bounded interval the distinction disappears">
A continuous function on a closed bounded interval $[\alpha,\beta]$ is necessarily uniformly continuous (the Heine–Cantor theorem). It was essential in <Ref to="ex-not-uniform" /> that $(0,1]$ is not a closed interval. Proving this theorem requires the completeness of $\mathbb{R}$ (the Bolzano–Weierstrass theorem, or the Heine–Borel covering theorem) and lies beyond the scope of this article. For a proof see Sugiura, *Kaiseki Nyūmon I*, Chapter I, or Rudin, *Principles of Mathematical Analysis*, Chapter 4. The theorem is used in an essential way in the proof that continuous functions are Riemann integrable ([The fundamental theorem of calculus and the definite integral](/mathematics/calculus/integration-and-ftc)).
</Remark>

## 7. Exercises

<Exercise id="exr-affine-general" difficulty="Easy">
Prove $\lim_{x\to3}(5x - 2) = 13$ directly from the definition (<Ref to="def-limit" />).
<Solution>
Let $\varepsilon>0$ be arbitrary and put $\delta = \dfrac{\varepsilon}{5} > 0$. For every real $x$ with $0 < |x - 3| < \delta$,

$$
|(5x-2) - 13| = |5x - 15| = 5|x-3| < 5\delta = 5 \cdot \frac{\varepsilon}{5} = \varepsilon
$$

Since $\varepsilon>0$ was arbitrary, <Ref to="def-limit" /> gives $\lim_{x\to3}(5x-2) = 13$.
</Solution>
</Exercise>

<Exercise id="exr-reciprocal" difficulty="Standard">
Prove $\lim_{x\to2} \dfrac1x = \dfrac12$ directly from the definition (construct $\delta$ explicitly, without using part (4) of <Ref to="thm-algebra" />).
<Solution>
First we rewrite. For $x \ne 0$,

$$
\left|\frac1x - \frac12\right| = \left|\frac{2 - x}{2x}\right| = \frac{|x-2|}{2|x|}
$$

To bound the $|x|$ in the denominator from below, restrict to $|x-2|<1$. Then $1 < x < 3$, so $|x| = x > 1$ and hence $\dfrac{1}{2|x|} < \dfrac12$, giving

$$
\left|\frac1x - \frac12\right| < \frac{|x-2|}{2}
$$

For this to be less than $\varepsilon$ it suffices that $|x-2| < 2\varepsilon$.

**Proof.** Let $\varepsilon>0$ be arbitrary and put $\delta = \min(1,\ 2\varepsilon) > 0$. Suppose $0 < |x-2| < \delta$. From $|x-2|<1$ we get $1 < x < 3$, in particular $x \ne 0$, so $1/x$ is defined, and the estimate above gives

$$
\left|\frac1x - \frac12\right| = \frac{|x-2|}{2|x|} < \frac{|x-2|}{2} < \frac{2\varepsilon}{2} = \varepsilon
$$

Hence $\lim_{x\to2} \dfrac1x = \dfrac12$.
</Solution>
</Exercise>

<Exercise id="exr-no-limit" difficulty="Standard">
Show that the function $s(x) = \sin\dfrac1x$ on $A = \mathbb{R}\setminus\{0\}$ has no limit as $x \to 0$.
<Solution>
We use <Ref to="thm-sequential" />. Suppose some $L \in \mathbb{R}$ satisfies $\lim_{x\to0} s(x) = L$.

Put $x_n = \dfrac{1}{2\pi n}$ and $y_n = \dfrac{1}{2\pi n + \pi/2}$ for $n \in \mathbb{N}$. Both are elements of $A$ and are nonzero, and from $0 < x_n < \dfrac1n$ and $0 < y_n < \dfrac1n$ the Archimedean property gives $x_n \to 0$ and $y_n \to 0$.

Since $s(x_n) = \sin(2\pi n) = 0$, the sequence $(s(x_n))$ is constantly $0$ and converges to $0$. Since $s(y_n) = \sin\left(2\pi n + \dfrac{\pi}{2}\right) = 1$, the sequence $(s(y_n))$ is constantly $1$ and converges to $1$.

By the implication from (1) to (2) in <Ref to="thm-sequential" />, the limit for both sequences would have to be $L$. Limits of sequences are unique (this is proved by the same argument as <Ref to="thm-uniqueness" />), so $L = 0$ and $L = 1$, giving the contradiction $0 = 1$. Hence no such $L$ exists and $\lim_{x\to0}\sin\dfrac1x$ does not exist.

The difference from $x\sin\dfrac1x$ in <Ref to="ex-xsin" /> is the amplitude. Multiplying by $x$ crushes the amplitude down to $0$ and produces convergence, whereas $s$ itself keeps taking both the values $0$ and $1$ over and over near $0$.
</Solution>
</Exercise>

<Exercise id="exr-square-uniform" difficulty="Hard">
Show that $f(x) = x^2$ is continuous on $\mathbb{R}$ but not uniformly continuous on $\mathbb{R}$.
<Solution>
**Continuity.** Fix $a \in \mathbb{R}$ and let $\varepsilon>0$ be arbitrary. Put $\delta = \min\left(1,\ \dfrac{\varepsilon}{1 + 2|a|}\right) > 0$. Suppose $|x - a| < \delta$. From $|x-a| < 1$ and the triangle inequality (§2),

$$
|x + a| = |(x - a) + 2a| \le |x-a| + 2|a| < 1 + 2|a|
$$

so that

$$
|x^2 - a^2| = |x-a|\,|x+a| < \frac{\varepsilon}{1+2|a|}\cdot(1 + 2|a|) = \varepsilon
$$

Hence <Ref to="def-continuity" /> shows that $f$ is continuous at $a$, and since $a$ was arbitrary, $f$ is continuous on $\mathbb{R}$ (this is also a special case of <Ref to="cor-polynomial" />).

**Failure of uniform continuity.** Take $\varepsilon_0 = 1$. Let $\delta>0$ be arbitrary and put

$$
x = \frac{1}{\delta} + \frac{\delta}{2}, \qquad y = \frac1\delta
$$

Then $|x - y| = \dfrac{\delta}{2} < \delta$, but

$$
|x^2 - y^2| = |x-y|\,|x+y| = \frac{\delta}{2}\left(\frac2\delta + \frac{\delta}{2}\right) = 1 + \frac{\delta^2}{4} > 1 = \varepsilon_0
$$

Therefore, for every $\delta>0$ there exist $x,y \in \mathbb{R}$ with $|x-y|<\delta$ and $|f(x)-f(y)| \ge \varepsilon_0$, so <Ref to="def-uniform-continuity" /> fails.

Here too the cause is that the slope grows steeper where $|x|$ is large, so the $\delta$ that respects a fixed $\varepsilon$ becomes arbitrarily small. The symptom was already visible in <Ref to="ex-square" />, where the only $\delta$ we could produce was $\delta = \min(1, \varepsilon/(2|a|+1))$, depending on $a$. If, however, the domain is restricted to a closed bounded interval $[-R,R]$, then $\delta = \min(1, \varepsilon/(1+2R))$ works independently of $a$, so the function is uniformly continuous there (in agreement with <Ref to="rem-heine-cantor" />).
</Solution>
</Exercise>

## References

- Sugiura Mitsuo, *Kaiseki Nyūmon I* (Introduction to Analysis I), University of Tokyo Press, 1980 (in Japanese) — Chapter I. This chapter runs from the continuity of the real numbers to the properties of continuous functions, and treats the standard handling of ε-δ arguments and uniform continuity in detail.
- Takagi Teiji, *Kaiseki Gairon* (A Course of Analysis), revised 3rd ed., Iwanami Shoten, 1961 (in Japanese) — Chapter 1. A Japanese classic; its introduction to limits and continuity is still worth reading.
- W. Rudin, *Principles of Mathematical Analysis*, 3rd ed., McGraw-Hill, 1976 — Chapter 4 (Continuity). Continuity is treated in the language of metric spaces, which shows how the arguments of this article generalize.
- S. Abbott, *Understanding Analysis*, 2nd ed., Springer, 2015 — Chapter 4 (Functional Limits and Continuity). Rich in pathological examples, including the Dirichlet and Thomae functions, with a careful account of why rigor is needed.
- Tajima Ichirō, *Epsilon-Delta*, Kyoritsu Shuppan (Sūgaku One Point Sōsho), 1978 (in Japanese) — a short book devoted to ε-δ arguments alone, focused squarely on the order of quantifiers.
- A.-L. Cauchy, *Cours d'analyse de l'École Royale Polytechnique*, 1821 — the historical source that placed limits at the foundation of analysis.
