Why Continuity Can Be Checked Piece by Piece
A piecewise-defined map often has a simple formula on each of several regions, while its behavior at the boundaries is harder to assess directly. A useful strategy is to prove continuity on each region and then show that the formulas agree where the regions overlap. The strategy works under a precise condition: the regions must form a finite closed cover of the domain. We will prove the result and examine what can go wrong when its hypotheses are removed.
Let \((X,\mathcal{T})\) and \((Y,\mathcal{U})\) be topological spaces. A map \(f:X\to Y\) is continuous if \(f^{-1}(V)\) is open in \(X\) for every open set \(V\) in \(Y\). For \(A\subseteq X\), the subspace topology on \(A\) consists of the sets \(A\cap U\), where \(U\in\mathcal{T}\). A map defined on \(A\) is continuous with respect to this subspace topology and the topology on its target.
To define a single map from maps \(f_i:A_i\to Y\), they must agree on every overlap: whenever \(x\in A_i\cap A_j\), we require \(f_i(x)=f_j(x)\). This condition makes the rule \(f(x)=f_i(x)\) for any \(i\) with \(x\in A_i\) independent of the choice of piece.
The Closed-Set Test for Continuity
Proof. Suppose first that \(f\) is continuous and \(C\) is closed in \(Y\). Then \(Y\setminus C\) is open, so \(f^{-1}(Y\setminus C)\) is open in \(X\). Since \(f^{-1}(Y\setminus C)=X\setminus f^{-1}(C)\), the set \(f^{-1}(C)\) is closed. Conversely, suppose the preimage of every closed set in \(Y\) is closed in \(X\). For any open \(V\subseteq Y\), its complement \(Y\setminus V\) is closed, and \(f^{-1}(V)=X\setminus f^{-1}(Y\setminus V)\). The right side is open because \(f^{-1}(Y\setminus V)\) is closed. Thus \(f\) is continuous by the definition. \(\square\)
The Finite Closed-Cover Pasting Theorem
Proof. The cover condition ensures that each \(x\in X\) belongs to at least one \(A_i\), so the rule assigns a value to every point. The agreement condition ensures that any two choices of \(i\) give the same value, so \(f\) is well-defined. Let \(C\subseteq Y\) be closed. By the definition of \(f\), \(f^{-1}(C)=\bigcup_{i=1}^n f_i^{-1}(C)\), where each preimage on the right is taken within \(A_i\). Since \(f_i\) is continuous, \(f_i^{-1}(C)\) is closed in the subspace \(A_i\). Thus there is a closed set \(F_i\subseteq X\) such that \(f_i^{-1}(C)=A_i\cap F_i\). Because \(A_i\) is closed in \(X\), the intersection \(A_i\cap F_i\) is closed in \(X\). The union is finite, so \(\bigcup_{i=1}^n f_i^{-1}(C)\) is closed in \(X\). The closed-set test for continuity now gives that \(f\) is continuous. \(\square\)
The proof identifies exactly where the assumptions enter. Coverage makes the rule defined everywhere; agreement makes it well-defined; closedness ensures that a closed subset of a piece is closed in \(X\); and finiteness ensures the resulting union of preimages is closed. No separation condition on \(X\) or \(Y\) is needed.
Worked Example: A Tent-Shaped Map on the Unit Interval
Give \(I=[0,1]\) the subspace topology inherited from \(\mathbb{R}\), and give \(\mathbb{R}\) its standard topology. Define \(A_1=[0,1/2]\), \(A_2=[1/2,1]\), with \(f_1(x)=2x\) on \(A_1\) and \(f_2(x)=2-2x\) on \(A_2\).
The two sets cover \(I\), since every \(x\in[0,1]\) satisfies either \(x\leq 1/2\) or \(x\geq 1/2\). They are closed in \(I\): their complements in \(I\) are respectively \((1/2,1]\) and \([0,1/2)\), both open in the subspace topology. Each formula is the restriction of a continuous affine function on \(\mathbb{R}\). Their overlap is \(\{1/2\}\), and the values there are \(f_1(1/2)=2(1/2)=1\) and \(f_2(1/2)=2-2(1/2)=1\). So they agree on the overlap. The theorem gives a continuous map \(f:I\to\mathbb{R}\).
For instance, \(1/4\in A_1\) and \(f(1/4)=2(1/4)=1/2\); \(3/4\in A_2\) and \(f(3/4)=2-2(3/4)=1/2\). At the endpoints, \(f(0)=0\) and \(f(1)=2-2=0\). Check: at the shared point both formulas give \(1\), so the piecewise rule assigns a single value there, as required.
Worked Example: The Absolute-Value Map
Let \(X=\mathbb{R}\) with its standard topology and take \(A_1=(-\infty,0]\), \(A_2=[0,\infty)\). Define \(f_1(x)=-x\) on \(A_1\) and \(f_2(x)=x\) on \(A_2\), with target \(\mathbb{R}\) in its standard topology.
The sets cover \(\mathbb{R}\) and are closed: each is the complement of an open half-line. Each piece formula is continuous as the restriction of a continuous affine function. The only overlap is \(\{0\}\), and \(f_1(0)=-0=0=f_2(0)\), so the rule defines a map on all of \(\mathbb{R}\). The pasting theorem proves it is continuous. For \(x=-3/4\), the left formula gives \(-(-3/4)=3/4\); for \(x=3/4\), the right formula gives \(3/4\). In both cases the global formula is \(f(x)=|x|\). Check: \(f(0)=0\) from either piece, confirming the boundary value is consistent.
Worked Example: Pasting on a Finite Discrete Space
Let \(X=\{a,b,c\}\) have the discrete topology, in which every subset is open, and let \(Y=\mathbb{R}\) have its standard topology. Set \(A_1=\{a,b\}\) and \(A_2=\{b,c\}\). Define \(f_1(a)=0,\ f_1(b)=1\) and \(f_2(b)=1,\ f_2(c)=2\).
Every subset of a discrete space is closed, and \(A_1\cup A_2=X\). Their overlap is \(\{b\}\), where both maps have value \(1\), so the rule defines \(f(a)=0,\ f(b)=1,\ f(c)=2\). Each restriction is continuous: every subset of either \(A_i\) is open in its discrete subspace topology, so the preimage of any open subset of \(\mathbb{R}\) is open in \(A_i\). The theorem therefore gives continuity of \(f\). Directly, for any open \(V\subseteq\mathbb{R}\), \(f^{-1}(V)\) is a subset of \(X\), hence open. Check: if \(V=(1/2,3/2)\), then \(f^{-1}(V)=\{b\}\), which is open in \(X\).
Why the Hypotheses Matter
Common mistake: replacing “closed cover” by “cover.” Consider \(X=\mathbb{R}\) with its standard topology and the cover \(A_1=(-\infty,0)\), \(A_2=[0,\infty)\). Define \(f_1(x)=0\) on \(A_1\) and \(f_2(x)=1\) on \(A_2\). Both restrictions are constant, hence continuous; the overlap is empty, so agreement there imposes no condition. The resulting map has \(f^{-1}((1/2,3/2))=[0,\infty)\), which is not open in \(\mathbb{R}\). Thus \(f\) is not continuous. The cover does cover \(X\), but \(A_1\) is not closed. A tempting but incorrect calculation is to say “the pieces cover, and both restrictions are continuous, so \(f\) is continuous.” The preimage just computed shows why the closedness hypothesis cannot be omitted.
Finiteness matters as well. Cover \(\mathbb{R}\) by the infinitely many closed sets \(\{x\}\), one for each \(x\in\mathbb{R}\). Define \(f(0)=1\) and \(f(x)=0\) for \(x\ne0\). On every singleton, the restriction is continuous: the only subsets of a singleton are open in its subspace topology, so every preimage is open. The restrictions agree wherever their domains overlap, since distinct singletons do not overlap. Nevertheless, \(f^{-1}((1/2,3/2))=\{0\}\), which is not open in \(\mathbb{R}\), so \(f\) is not continuous. In the finite-cover proof, a finite union of closed sets is closed; an infinite union need not be.
Agreement and coverage have different roles. If \(X=[-1,1]\), \(A_1=[-1,0]\), and \(A_2=[0,1]\), the constant maps \(f_1=0\) and \(f_2=1\) are continuous on their pieces, but they disagree at \(0\). There is no single function on \(X\) that has both prescribed values there. If the pieces do not cover \(X\), the piecewise rule does not assign any value to points outside their union, so it does not define a map \(X\to Y\). These are failures before continuity is even considered.
The practical test is therefore ordered: first check that the pieces cover the entire domain; next check agreement on every overlap; then verify that the cover is finite and each piece is closed; finally prove continuity of each restriction. When those conditions hold, the theorem handles continuity of the global map without a separate boundary-by-boundary argument.
Check Your Understanding
For each question, identify the hypotheses you use and distinguish continuity on a piece from continuity on the whole space.
- Why does a closed subset of a closed subspace \(A_i\) have to be closed in \(X\)? Express the subset as an intersection with a closed subset of \(X\).
- On \(\mathbb{R}\), define \(f(x)=x\) for \(x\leq 0\) and \(f(x)=2x\) for \(x\geq0\). Verify that the two formulas agree on the overlap, then apply the theorem.
- In the nonclosed-cover counterexample, which open set in the target has a preimage that is not open?
- Why are the restrictions of any function to the singleton pieces of the discrete singleton cover continuous?
- Give an example of two continuous maps on a closed cover that fail to define a global map, and identify the failed condition.