2. Uniform Continuity
Definition 2.1 (Uniform continuity)
f: I → ℝ is uniformly continuous on I if:
Observation 2.2
The central point is that the same δ must hold simultaneously for every pair of points x,y ∈ I chosen in the interval, and can no longer be adapted case by case as in pointwise continuity. This is reflected in the order of the quantifiers: writing out continuity on all of I ( Definition 1.2 applied at every point) we get:
while uniform continuity is:
The difference is precisely the position of the "for every point" quantifier: in plain continuity it precedes ∃δ (so δ can depend on the point, δ=δ(ε,x₀), because it is chosen after fixing the point); in uniform continuity the role of the point is taken by x,y, which are quantified after ∃δ — δ must therefore be chosen before knowing which points will be considered, and it must work for all of them. Swapping the order of a ∀ and an ∃ in a logical formula is never harmless: it is exactly what distinguishes the two notions. Every uniformly continuous function on I is continuous on I (just fix y=x₀ in the definition); the converse, as we will see, is false in general.
Proposition 2.1 (Sequential criterion for non-uniform continuity)
f: I → ℝ is not uniformly continuous on I if and only if there exist ε₀ > 0 and two sequences (xₙ), (yₙ) ⊂ I such that:
Proof. (⇐) If such sequences exist, no δ > 0 can satisfy the definition for ε = ε₀: for every δ, since |xₙ−yₙ| → 0, there exists n with |xₙ−yₙ| < δ, yet |f(xₙ)−f(yₙ)| ≥ ε₀.
(⇒) If f is not uniformly continuous, negating the definition: ∃ε₀ > 0 such that ∀δ > 0 ∃x,y ∈ I with |x−y| < δ but |f(x)−f(y)| ≥ ε₀. Applying this with δ = 1/n for every n ∈ ℕ we obtain xₙ,yₙ ∈ I with |xₙ−yₙ| < 1/n and |f(xₙ)−f(yₙ)| ≥ ε₀, hence |xₙ−yₙ| → 0.
∎
Example 2.1 (A uniformly continuous function)
f(x) = √x is uniformly continuous on [0, +∞). Given ε > 0, we want to guarantee |√x−√y| < ε. We first need the inequality:
which we prove right away, before using it. Assume, without loss of generality, x ≥ y ≥ 0 (the inequality is symmetric in x,y, so it suffices to handle one ordering); set u = √x, v = √y (so u ≥ v ≥ 0), we want to show u−v ≤ √(u²−v²) = √((u−v)(u+v)). If u=v it is trivial; if u>v, squaring both (positive) sides the statement is equivalent to (u−v)² ≤ (u−v)(u+v), i.e., dividing by u−v>0, to u−v ≤ u+v, always true since v ≥ 0. This proves the inequality.
It follows that it is sufficient to impose:
to obtain a fortiori |√x−√y| < ε. So let δ := ε²: if |x−y| < δ, then |√x−√y| ≤ √|x−y| < √δ = ε. Note that δ does not depend on the point: the same choice works everywhere, and this is exactly what makes f uniformly (and not merely pointwise) continuous.

Counterexample 2.1 (f(x)=1/x is not uniformly continuous)
f(x) = 1/x is not uniformly continuous on (0,1). Take xₙ = 1/n, yₙ = 1/(2n): then |xₙ−yₙ| = 1/(2n) → 0, but:
so in particular |f(xₙ)−f(yₙ)| ≥ 1 =: ε₀ eventually. By Proposition 2.1, f is not uniformly continuous, even though it is continuous at every point of (0,1).

Delicate case 2.1 (f(x)=x² is continuous everywhere but not uniformly continuous on ℝ)
It is a common mistake to think that a function continuous "everywhere" (on all of ℝ, not just on a bounded interval) is automatically uniformly continuous. This is not the case: f(x) = x² is continuous on all of ℝ but not uniformly continuous on ℝ. Take xₙ = n, yₙ = n + 1/n: then:
By Proposition 2.1, f(x)=x² is not uniformly continuous on ℝ. The phenomenon is clear: the slope of x² grows without bound, so the same δ that "works well" near the origin stops working far from it. As the Heine–Cantor theorem below shows, the situation changes radically if we restrict to a compact interval [a,b]: there, x² is uniformly continuous.

Theorem 2.1 (Heine–Cantor)
A function continuous on a compact set is uniformly continuous there [2].
Proof. Let K ⊆ ℝ be a compact set and f: K → ℝ a function continuous on K. Suppose for contradiction that f is not uniformly continuous on K. By Proposition 2.1, there exist ε₀ > 0 and sequences (xₙ),(yₙ) ⊂ K with |xₙ−yₙ| → 0 and |f(xₙ)−f(yₙ)| ≥ ε₀ for every n.
Since K is bounded, by the Bolzano–Weierstrass theorem the sequence (xₙ) admits a convergent subsequence xₙₖ → x*; since K is closed, x* ∈ K. Moreover, since (|xₙₖ−yₙₖ|)ₖ is a subsequence of (|xₙ−yₙ|)ₙ and the latter tends to 0, also |xₙₖ−yₙₖ| → 0; hence:so also yₙₖ → x*. By continuity of f at x*, f(xₙₖ) → f(x*) and f(yₙₖ) → f(x*), hence:contradicting |f(xₙₖ)−f(yₙₖ)| ≥ ε₀ for every k. Contradiction.
∎
Corollary 2.1
On a compact set K, continuity and uniform continuity coincide: C(K) coincides with the set of uniformly continuous functions on K.