The topological definition of continuity: preimages of open sets are open. Equivalent characterizations via sequences and epsilon-delta on metric spaces.
Continuity is the backbone of analysis. In this chapter we develop the notion of a continuous function first in the very general setting of topological spaces, then specialize to metric spaces where it coincides with the familiar epsilon-delta condition and with sequential continuity. We then discuss uniform continuity, Lipschitz continuity, homeomorphisms, and the limit of a function at a point. Much of this material is a more abstract recasting of ideas from MATH/MTHE 281.
Continuity in Topological Spaces
The topological definition of continuity refers only to open sets. It makes no reference to distances, sequences, or epsilons.
DefinitionTopological Continuity
Let (X,τ) and (Y,σ) be topological spaces and let f:X→Y. We say that f is continuous if, for every open set Ω∈σ,
f−1(Ω)={x∈X:f(x)∈Ω}∈τ.
That is, the preimage of every open set is open.
Remark.
Intuition: Continuity means that information pulls back nicely: if you "zoom in" on a region of the target Y (an open set), the points of X that land there form an open region too. There are no jumps — nearby points are sent to nearby points, where "nearby" is expressed through the open sets. This definition is powerful because it works in any topological space, not just metric spaces.
TheoremEquivalent Characterizations of Continuity
Let f:(X,τ)→(Y,σ). The following are equivalent:
(i)f is continuous.
(ii) For every closed set F⊆Y, the set f−1(F) is closed in X.
(iii) For every A⊆X, f(A)⊆f(A).
(iv) For every B⊆Y, f−1(B)⊆f−1(B).
Remark.
Intuition: Continuity has many equivalent faces. The open-set version is the cleanest, but sometimes it is more convenient to argue about closed sets, or to say that the image of the closure is contained in the closure of the image — which expresses "points accumulating in A get sent to points accumulating in f(A)."
Local Continuity
Continuity is defined globally above, but there is also a pointwise version.
DefinitionContinuity at a Point
Let f:(X,τ)→(Y,σ) and let x0∈X. We say that f is continuous at x0 if for every open neighbourhood V of f(x0), there exists an open neighbourhood U of x0 such that f(U)⊆V.
Remark.
Intuition: Continuity at a point says that we can force f to land in any prescribed neighbourhood of f(x0) by starting from a small enough neighbourhood of x0. This is the topological generalization of "nearby inputs produce nearby outputs."
TheoremGlobal Continuity via Pointwise Continuity
f:(X,τ)→(Y,σ) is continuous if and only if f is continuous at every point x0∈X.
Continuity in Metric Spaces
We now specialize to metric spaces, where distances make several additional characterizations available.
DefinitionEpsilon-Delta Continuity
Let (X,dX) and (Y,dY) be metric spaces and let f:X→Y. We say that f is continuous at x0∈X if for every ε>0 there exists δ>0 such that
dX(x,x0)<δ⟹dY(f(x),f(x0))<ε.
We say f is continuous if it is continuous at every x0∈X.
Remark.
Intuition: This is the familiar definition from calculus: given any desired output tolerance ε, we can find an input tolerance δ that guarantees it. The quantifier order matters: ε is chosen first, then δ depends on both ε and x0.
DefinitionSequential Continuity
Let (X,dX) and (Y,dY) be metric spaces. We say that f:X→Y is sequentially continuous at x0 if for every sequence (xn)⊆X with xn→x0, we have f(xn)→f(x0).
Remark.
Intuition: Sequential continuity says: if inputs converge to x0, then outputs converge to f(x0). This formulation is often the easiest to use in practice, since sequences are concrete objects.
TheoremEquivalence of Continuity Notions in Metric Spaces
Let (X,dX) and (Y,dY) be metric spaces, equipped with their metric topologies, and let f:X→Y. The following are equivalent:
(i)f is topologically continuous (preimage of open is open).
(ii)f is ε-δ continuous at every point.
(iii)f is sequentially continuous at every point.
ExampleBasic Continuous Maps
(1) The identity map id:(X,τ)→(X,τ) is always continuous, since id−1(Ω)=Ω.
(2) Any constant map f≡c is continuous: f−1(Ω) is either X or ∅, both open.
(3) The map f:R→R defined by f(x)=x2 is continuous: given x0 and ε>0, take δ=min{1,ε/(2∣x0∣+1)}. Then ∣x−x0∣<δ gives ∣x∣≤∣x0∣+1 and
∣x2−x02∣=∣x−x0∣⋅∣x+x0∣≤δ(2∣x0∣+1)≤ε.
(4) The Dirichlet function χQ:R→R, equal to 1 on rationals and 0 on irrationals, is nowhere continuous. Indeed for any x0∈R we can find rationals rn→x0 and irrationals in→x0, so χQ(rn)→1 and χQ(in)→0; sequential continuity fails.
Composition, Algebraic Operations, Restrictions
TheoremComposition of Continuous Maps
Let (X,τ), (Y,σ), (Z,ρ) be topological spaces and let f:X→Y, g:Y→Z be continuous. Then g∘f:X→Z is continuous.
Remark.
Intuition: Continuity composes. Reading the proof, this is essentially just a restatement of the identity (g∘f)−1(W)=f−1(g−1(W)).
TheoremAlgebraic Operations on Real-Valued Continuous Functions
Let (X,d) be a metric space and let f,g:X→R be continuous at x0∈X. Then f+g, f−g, fg are continuous at x0, and f/g is continuous at x0 whenever g(x0)=0.
TheoremContinuity and Restrictions
Let f:(X,τ)→(Y,σ) be continuous and let A⊆X, equipped with the relative topology τA. Then f∣A:(A,τA)→(Y,σ) is continuous.
Continuous Functions on R and Rn
In Rn with the Euclidean topology, continuity is equivalent to continuity of each component function.
TheoremComponentwise Continuity
Let (X,d) be a metric space and let f:X→Rn, f(x)=(f1(x),…,fn(x)). Then f is continuous at x0 if and only if each fi:X→R is continuous at x0.
ExamplePolynomials and Rational Functions
Every polynomial p:Rn→R is continuous on all of Rn, since polynomials are built from continuous coordinate projections via sums and products. Every rational function p/q is continuous at every point where q=0.
Uniform Continuity
Continuity is pointwise: the δ depends on both ε and the base point x0. Uniform continuity requires a single δ that works for all points simultaneously.
DefinitionUniform Continuity
Let (X,dX) and (Y,dY) be metric spaces. A function f:X→Y is uniformly continuous if for every ε>0 there exists δ>0 such that for all x,x′∈X,
dX(x,x′)<δ⟹dY(f(x),f(x′))<ε.
Remark.
Intuition: Ordinary continuity allows δ to shrink as we move to different parts of the domain; uniform continuity forbids this. A uniformly continuous function never becomes "arbitrarily steep" over its domain. Any uniformly continuous function is continuous; the converse fails in general.
ExampleContinuous but not Uniformly Continuous
f:R→R with f(x)=x2 is continuous but not uniformly continuous. Given δ>0, take xn=n and xn′=n+δ/2; then ∣xn−xn′∣=δ/2<δ, yet
∣f(xn)−f(xn′)∣=∣2n⋅δ/2+(δ/2)2∣=nδ+δ2/4→∞.
So no single δ works for ε=1.
TheoremHeine-Cantor Theorem
Let (X,dX) be a compact metric space and let (Y,dY) be a metric space. Every continuous function f:X→Y is uniformly continuous.
Remark.
Intuition: On a compact set, there is no "room at infinity" for continuity to deteriorate. Because the domain is totally controlled, the pointwise δ's admit a uniform lower bound.
Lipschitz Continuity
A strong quantitative form of continuity that implies uniform continuity.
DefinitionLipschitz Continuous Function
A function f:(X,dX)→(Y,dY) is Lipschitz continuous (with constant K) if there exists K≥0 such that
dY(f(x),f(x′))≤KdX(x,x′)for all x,x′∈X.
The smallest such K is the Lipschitz constant of f, denoted Lip(f). If K<1, f is called a contraction.
Remark.
Intuition: Lipschitz continuity is a uniform "slope bound." The ratio of output change to input change can never exceed K. Differentiable functions on R with bounded derivative are Lipschitz; the Lipschitz constant equals the sup of ∣f′∣.
TheoremLipschitz Implies Uniformly Continuous
Every Lipschitz continuous function is uniformly continuous.
ExampleLipschitz Examples and Non-Examples
(1) The absolute value function x↦∣x∣ on R is Lipschitz with constant 1 (by the reverse triangle inequality).
(2) For any fixed y∈(X,d), the distance function x↦d(x,y) is Lipschitz with constant 1:
∣d(x,y)−d(x′,y)∣≤d(x,x′)
(reverse triangle inequality).
(3)f(x)=x on [0,∞) is uniformly continuous but not Lipschitz, because near 0 the slope blows up: ∣x−0∣/∣x−0∣=1/x→∞ as x→0+.
Holder Continuity
An intermediate notion between plain uniform continuity and Lipschitz continuity: a sub-linear power-law bound on the modulus of continuity.
DefinitionHolder Continuous Function
Let α∈(0,1]. A function f:(X,dX)→(Y,dY) is Holder continuous of exponent α if there exists K≥0 such that
dY(f(x),f(x′))≤KdX(x,x′)αfor all x,x′∈X.
The constant K is a Holder constant of f; the smallest such K is the Holder seminorm. The case α=1 recovers Lipschitz continuity.
Remark.
Intuition: Holder continuity with exponent α<1 allows the modulus of continuity to blow up like hα−1 near zero — steeper than Lipschitz but tamer than arbitrary uniform continuity. It is the natural setting for many fractal and regularity estimates in analysis. The canonical example is f(x)=x on [0,1]: Holder-1/2 but not Lipschitz.
TheoremHolder Implies Uniformly Continuous
Every Holder-continuous function is uniformly continuous.
ExampleSquare Root is Holder-1/2 but not Lipschitz
f(x)=x on [0,1] satisfies
∣x−y∣≤∣x−y∣
for all x,y∈[0,1] (squaring both sides, ∣x−y∣≤∣x−y∣⋅(x+y), which is immediate). So f is Holder-1/2 with constant K=1. It is not Lipschitz because ∣x−0∣/∣x−0∣=1/x→∞ as x→0+.
Remark.
Hierarchy: Lipschitz ⇒ Holder-α (for any α∈(0,1], on bounded domains) ⇒ uniformly continuous ⇒ continuous. All implications are strict. Holder continuity is most often used with α∈(0,1); the borderline α=1 is Lipschitz, while "Holder with α>1" on a connected domain would force f to be constant (the difference quotient is bounded by K∣x−x′∣α−1→0, so f′≡0).
Homeomorphisms
DefinitionHomeomorphism
A map f:(X,τ)→(Y,σ) is a homeomorphism if f is a bijection, f is continuous, and f−1 is continuous. Two spaces are homeomorphic if a homeomorphism between them exists.
Remark.
Intuition: A homeomorphism is an isomorphism of topological spaces: it matches up points AND open sets. Homeomorphic spaces have the same topological properties — connectedness, compactness, Hausdorffness, etc. A donut and a coffee cup are the classical example of homeomorphic spaces that differ geometrically but not topologically.
ExampleHomeomorphism Examples
(1) The open interval (−1,1) and R are homeomorphic via f(x)=tan(πx/2), with inverse g(y)=(2/π)arctan(y). Both are continuous.
(2) The closed square [0,1]2 and the closed disk B1(0)⊆R2 are homeomorphic (radially stretch the square onto the disk).
(3)[0,1) and R are not homeomorphic. If they were, connectedness would be preserved, but removing any interior point of [0,1) disconnects it into two components or leaves it connected depending on the point; while removing any point of R produces two components. A careful argument using connectedness shows these spaces cannot be topologically equivalent.
TheoremContinuous Bijection on Compact Space is a Homeomorphism
Let f:(X,τ)→(Y,σ) be a continuous bijection, where (X,τ) is compact and (Y,σ) is Hausdorff. Then f is a homeomorphism.
Limits of Functions
We now define the limit of a function at a point, first in full topological generality (neighbourhood form), then specialize to metric spaces (epsilon-delta form), and finally record the sequential characterization. In a metric space all three notions coincide.
DefinitionLimit of a Function (Topological)
Let (X,τ) and (Y,σ) be topological spaces, A⊆X, f:A→Y, and let a∈X be an accumulation point of A (every open neighbourhood of a meets A∖{a}). We say that L∈Y is a limit of f at a, and write limx→af(x)=L, if for every open neighbourhood V of L there exists an open neighbourhood U of a such that
f(U∩A∖{a})⊆V.
Remark.
Intuition: This is the most general form: "pull back every target neighbourhood to a source neighbourhood, ignoring the point a itself." The formulation makes no reference to distances — only to open sets. In Hausdorff spaces this limit, when it exists, is unique by essentially the same argument as for sequences.
DefinitionLimit of a Function (Metric, Epsilon-Delta)
Let (X,dX) and (Y,dY) be metric spaces, A⊆X, f:A→Y, and let a∈X be an accumulation point of A (i.e. every punctured ball around a meets A). We write
limx→af(x)=L
if for every ε>0 there exists δ>0 such that for all x∈A,
0<dX(x,a)<δ⟹dY(f(x),L)<ε.
Remark.
Intuition: The limit of f at a is the value that f(x) approaches as x approaches a, but without touching a itself. The requirement that a be an accumulation point ensures we can actually approach a through A. The value of f at a (if defined) is irrelevant.
TheoremEquivalence of Topological, Metric, and Sequential Limits
Let (X,dX) and (Y,dY) be metric spaces with their metric topologies, A⊆X, f:A→Y, and let a∈X be an accumulation point of A. The following are equivalent:
(i)limx→af(x)=L in the topological sense (preimage of every open neighbourhood of L contains a punctured open neighbourhood of a, intersected with A).
(ii)limx→af(x)=L in the ε-δ sense.
(iii) For every sequence (xn)⊆A∖{a} with xn→a, f(xn)→L.
TheoremSequential Characterization of Limits
Under the assumptions of the definition, limx→af(x)=L if and only if for every sequence (xn)⊆A∖{a} with xn→a, we have f(xn)→L.
TheoremContinuity in Terms of Limits
Let f:(X,dX)→(Y,dY) and x0∈X be an accumulation point of X. Then f is continuous at x0 if and only if limx→x0f(x)=f(x0).
Algebraic Properties of Limits
TheoremAlgebra of Limits
Let f,g:A→R with A⊆X, and suppose limx→af(x)=L1, limx→ag(x)=L2. Then:
(i)limx→a(f(x)+g(x))=L1+L2.
(ii)limx→a(f(x)g(x))=L1L2.
(iii) If L2=0, limx→af(x)/g(x)=L1/L2.
TheoremLimit of a Composition
Let (X,dX), (Y,dY), (Z,dZ) be metric spaces, let A⊆X, B⊆Y, g:A→B and f:B→Z. Suppose a is an accumulation point of A, b is an accumulation point of B, and
limx→ag(x)=b,limy→bf(y)=L.
If either (i) f is continuous at b (equivalently, f(b)=L) or (ii) g(x)=b for every x in some punctured neighbourhood of a intersected with A, then
limx→a(f∘g)(x)=L.
Remark.
Intuition: The naive "plug one limit into the other" is correct almost always, but fails in a subtle edge case: if g(x) happens to equal b for x near a but b is not in the domain of f with value L, the limit of f∘g can see the "punctured-out" value of f at b. The two clauses rule out that pathology — either f behaves at b (it is continuous there) or g never hits b near a.
One-Sided Limits, Limits at Infinity, Infinite Limits
For real-valued functions of a real variable, several variants of the limit notion appear in practice. We give them here in the concrete metric setting; in each case the idea is to modify the source (approach from one side, or x→±∞) or the target (allow the value ±∞) while keeping the logical structure of the definition intact.
DefinitionOne-Sided Limits
Let f:A→R with A⊆R, and let a∈R be an accumulation point of A∩(a,∞) (respectively A∩(−∞,a)).
The right limit of f at a is
limx→a+f(x)=L⟺∀ε>0∃δ>0 s.t. a<x<a+δ,x∈A⟹∣f(x)−L∣<ε.
The left limit of f at a is
limx→a−f(x)=L⟺∀ε>0∃δ>0 s.t. a−δ<x<a,x∈A⟹∣f(x)−L∣<ε.
Remark.
Intuition: One-sided limits only "approach from one side" of a. They let us describe jump discontinuities (where f(a−)=f(a+)) and are the natural concept at boundary points of intervals. The two-sided limit limx→af(x) exists iff both one-sided limits exist and agree.
TheoremTwo-Sided Limit via One-Sided Limits
Let f:A→R with A⊆R and a an accumulation point of both A∩(a,∞) and A∩(−∞,a). Then limx→af(x)=L if and only if limx→a+f(x)=L and limx→a−f(x)=L.
DefinitionLimits at Infinity
Let f:A→R with A⊆R unbounded above. Then
limx→∞f(x)=L⟺∀ε>0∃M∈R s.t. x>M,x∈A⟹∣f(x)−L∣<ε.
The definition of limx→−∞f(x)=L is analogous (replace x>M with x<M, and require A unbounded below).
Remark.
Intuition: "x large enough" plays the role of "x close enough to a" — only the source has changed. Equivalently, limx→∞f(x)=L iff for every sequence xn→∞ in A, f(xn)→L.
DefinitionInfinite Limits
Let f:A→R with A⊆R and a an accumulation point of A. Then
limx→af(x)=+∞⟺∀M∈R∃δ>0 s.t. 0<∣x−a∣<δ,x∈A⟹f(x)>M.
The definition with −∞ is analogous (replace f(x)>M with f(x)<M). One can combine the variants: limx→∞f(x)=+∞, limx→a+f(x)=−∞, and so on, each by modifying the appropriate clause.
Remark.
Intuition: "f(x) close to L" has been replaced by "f(x) bigger than any threshold M" — only the target has changed. These are not limits in the strict metric sense (since ±∞∈/R); they are limits in the extended real line [−∞,+∞], which is a compact topological space whose neighbourhoods of ±∞ are the sets (M,∞] and [−∞,M).
Oscillation and Discontinuities
We classify how a function can fail to be continuous at a point, using the notion of oscillation.
DefinitionOscillation of a Function
Let f:(X,d)→R be a bounded function and A⊆X nonempty. The oscillation of f on A is
osc(f,A)=supx∈Af(x)−infx∈Af(x).
The oscillation of f at x0∈X is
ωf(x0)=limr→0+osc(f,Br(x0))=infr>0osc(f,Br(x0)).
(The limit exists because r↦osc(f,Br(x0)) is nonnegative and nondecreasing.)
Remark.
Intuition: The oscillation ωf(x0) measures how much f jumps near x0. It is zero exactly when f is continuous at x0, so it serves as a quantitative failure-of-continuity.
TheoremOscillation Characterizes Continuity
Let f:(X,d)→R be bounded. Then f is continuous at x0 if and only if ωf(x0)=0.
Classification of Discontinuities on R
For a function f:R→R, define the one-sided limits f(x0−)=limx→x0−f(x) and f(x0+)=limx→x0+f(x) when they exist.
Removable discontinuity:f(x0−)=f(x0+)=f(x0) (or f(x0) is undefined). Redefining f at one point restores continuity.
Jump (first-kind) discontinuity:f(x0−) and f(x0+) both exist and are finite, but differ. The oscillation is ∣f(x0+)−f(x0−)∣.
Essential (second-kind) discontinuity: at least one of f(x0−), f(x0+) fails to exist (for instance because of oscillation, as in sin(1/x) at x=0).
ExampleSet of Discontinuities is an F-sigma Set
For any function f:R→R, the set
Df={x0∈R:f is discontinuous at x0}=⋃n=1∞{x0:ωf(x0)≥1/n}
is a countable union of closed sets (an Fσ set). This is a key ingredient in showing, via the Baire Category Theorem, that there is no function f:R→R whose set of continuity points is exactly Q.
The Continuity Set is a G-Delta Set
We now prove a theorem that, combined with the fact that Q is not a Gδ set, rules out the existence of any function continuous exactly at the rationals.
DefinitionG-delta and F-sigma Sets
A set S⊆R (or in any topological space) is a Gδ set if it can be written as a countable intersection of open sets. ("G" stands for Gebiet, German for "area"; "δ" for Durchschnitt, "intersection.")
A set S is an Fσ set if it can be written as a countable union of closed sets. ("F" stands for fermé, French for "closed"; "σ" denotes countable unions.)
Remark:S is Gδ if and only if Sc is Fσ.
ExampleExamples of G-delta and F-sigma Sets
(1) Every open set is Gδ; every closed set is Fσ.
(2) Singletons are both Fσ (they are closed) and Gδ (since {x}=⋂n≥1(x−1/n,x+1/n)).
(3) Every countable set is Fσ. In particular Q is Fσ.
(4)R∖Q is Gδ, since its complement Q is Fσ. Equivalently, R∖Q=⋂r∈Q(R∖{r}).
(5) Countable intersections of Gδ sets are Gδ; countable unions of Fσ sets are Fσ.
TheoremThe Set of Continuity Points is a G-delta Set
Let f:R→R and let Cf be the set of points at which f is continuous. Then Cf is a Gδ set.
Remark.
Intuition: Continuity is a "for every ε" condition; quantifying over countably many ε=1/n expresses Cf as a countable intersection. Each individual condition cuts out an open set, so the intersection is Gδ.
TheoremQ is Not a G-delta Set
The set of rationals Q is not a Gδ set in R.
CorollaryNo Function is Continuous Exactly on Q
There is no function f:R→R whose set of continuity is Q.
Remark.
The converse holds: for everyGδ set S⊆R there does exist a function f:R→R with Cf=S. Sketch: write E=Sc=⋃nFn with each Fn closed and (WLOG) nested F1⊆F2⊆⋯. Set An=Fn∩Q and fn=1Fn−1An. The series f=∑n=1∞n!1fn converges uniformly on R to a bounded function whose continuity set is exactly S.
The Thomae (Popcorn) Function
A spectacular concrete example of a function continuous on the irrationals and discontinuous on the rationals.
ExampleThe Thomae / Popcorn Function
Define f:R→R by
f(x)={01/nif x∈R∖Q,if x=m/n∈Q in lowest terms with n∈N,m∈Z.
By convention, 0=0/1 in lowest terms, so f(0)=1. For example f(12/13)=1/13, f(−30)=1, f(−1/2)=1/2, and f(2)=f(π)=f(e)=0.
This function is also called the popcorn function or stars over Babylon.
Claim:f is continuous at every irrational and discontinuous at every rational.
Proof of discontinuity at rationals: Let q∈Q with f(q)=1/n>0. Since irrationals are dense, pick irrationals xk→q; then f(xk)=0→1/n.
Proof of continuity at irrationals: Let x0∈R∖Q and fix ε>0. Choose N with 1/N<ε. The set
{p/q:q≤N,p∈Z,∣p/q−x0∣≤1}
is finite (finitely many denominators, each contributing finitely many numerators in a bounded range). Hence there exists δ>0 such that no rational with denominator ≤N lies in (x0−δ,x0+δ) (other than possibly x0 itself, but x0 is irrational). For ∣x−x0∣<δ: if x is irrational, ∣f(x)−f(x0)∣=0<ε; if x=m/n in lowest terms, then n>N, so ∣f(x)−0∣=1/n<1/N<ε. □
Continuity and Connectedness: The Intermediate Value Theorem
We close with a classical application: the topological version of the Intermediate Value Theorem, which is a direct consequence of Bolzano's theorem that continuous functions preserve connectedness.
TheoremBolzano's Theorem
Let f:(X,τ)→(Y,σ) be continuous and surjective. If (X,τ) is connected, then (Y,σ) is connected. More generally, if A⊆X is connected, then f(A) is connected.
CorollaryIntermediate Value Theorem
Let f:[a,b]→R be continuous. If y lies between f(a) and f(b), there exists c∈[a,b] with f(c)=y.
CorollaryExtreme Value Theorem
Let X be a nonempty compact topological space and f:X→R continuous. Then f attains its maximum and minimum on X.