Tutorials › Topology (Undergraduate) › The Closed-Set Test for Continuity

Continuous Maps and Homeomorphisms · Tutorial 188 of 799

The Closed-Set Test for Continuity

Use closed sets in the target to test continuity, with proofs and examples that distinguish a full continuity argument from a single preimage calculation.

Intermediate 9 min read

What You'll Learn

  • State and prove the closed-set test for continuity.
  • Translate between open preimages and closed preimages using complements.
  • Prove continuity of the squaring map by checking arbitrary closed sets.
  • Apply the test to maps whose domains have different topologies.
  • Detect discontinuity from one closed set with a nonclosed preimage.
  • Avoid confusing one successful preimage check with a proof of continuity.

Continuity Tested by Closed Sets

Continuity is usually defined by asking that preimages of open sets be open. There is an equivalent test using closed sets instead. This version is useful when the closed sets in the target are easier to describe, and it can also detect discontinuity: a single closed set with a preimage that is not closed is enough to disprove continuity.

Let \((X,\mathcal{T})\) and \((Y,\mathcal{S})\) be topological spaces, and let \(f:X\to Y\). A set \(C\subseteq Y\) is closed when \(Y\setminus C\) is open. The preimage of \(C\) is \(f^{-1}(C)=\{x\in X:f(x)\in C\}\). We use the definition that \(f\) is continuous if \(f^{-1}(V)\) is open in \(X\) for every open set \(V\) in \(Y\).

Theorem (Closed-set test for continuity): A map \(f:X\to Y\) is continuous if and only if \(f^{-1}(C)\) is closed in \(X\) for every closed set \(C\subseteq Y\).

Proof. For any \(C\subseteq Y\), membership in a preimage gives the identity \(f^{-1}(Y\setminus C)=X\setminus f^{-1}(C)\): a point \(x\) belongs to the left side exactly when \(f(x)\notin C\), which is exactly when \(x\notin f^{-1}(C)\). 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\). By the identity, this set is the complement of \(f^{-1}(C)\), hence \(f^{-1}(C)\) is closed. Conversely, suppose the preimage of every closed subset of \(Y\) is closed in \(X\). If \(V\) is open in \(Y\), then \(Y\setminus V\) is closed. The assumption makes \(f^{-1}(Y\setminus V)\) closed; the identity says this is \(X\setminus f^{-1}(V)\). Therefore \(f^{-1}(V)\) is open, which is continuity. Both arguments also apply if \(X\) or \(Y\) is empty. \(\square\)

The quantifier “every” matters. To prove continuity by this test, one must handle an arbitrary closed target set, not just a convenient selection of closed sets. To disprove continuity, by contrast, one counterexample suffices.

Working with the Test

Worked Example: A Constant Map

Let \(X\) and \(Y\) be any topological spaces, choose \(y_0\in Y\), and define \(f:X\to Y\) by \(f(x)=y_0\) for every \(x\in X\). We check the preimage of an arbitrary closed set \(C\subseteq Y\).

If \(y_0\in C\), then every \(x\in X\) satisfies \(f(x)\in C\), so \(f^{-1}(C)=X\). The whole space is closed because its complement, \(\varnothing\), is open. If \(y_0\notin C\), no \(x\in X\) maps into \(C\), so \(f^{-1}(C)=\varnothing\), which is closed because its complement is \(X\), an open set. Thus the preimage is closed in either case, for every closed \(C\), and the closed-set test proves that \(f\) is continuous.

Check: For \(C=\{y_0\}\), the preimage is \(X\); for \(C=\varnothing\), the preimage is \(\varnothing\). These agree with the two cases above. If \(X=\varnothing\), every preimage is \(\varnothing\), so the conclusion still holds.

Worked Example: The Squaring Map

Take \(\mathbb{R}\) with its standard topology in both domain and target, and set \(f(x)=x^2\). We prove continuity using the closed-set test, checking an arbitrary closed \(C\subseteq\mathbb{R}\). We first justify the sequence test for closedness that the argument uses.

Metric closedness criterion. In a metric space \((M,d)\), a set \(A\subseteq M\) is closed if and only if every convergent sequence \((a_n)\) in \(A\) has its limit in \(A\). To prove the forward direction, suppose \(A\) is closed and \(a_n\in A\) converges to \(a\). If \(a\notin A\), the open set \(M\setminus A\) contains \(a\), so it contains a ball \(B_d(a,r)\) for some \(r>0\). Convergence gives \(a_n\in B_d(a,r)\) for all sufficiently large \(n\), contradicting \(a_n\in A\). Hence \(a\in A\). For the reverse direction, suppose every convergent sequence in \(A\) has its limit in \(A\). If \(A\) were not closed, \(M\setminus A\) would not be open. There would be a point \(a\in M\setminus A\) such that no ball about \(a\) is contained in \(M\setminus A\). For each \(n\in\mathbb{N}\), choose \(a_n\in A\cap B_d(a,1/n)\). Then \(d(a_n,a)<1/n\), so \(a_n\to a\), while \(a\notin A\), a contradiction. Therefore \(A\) is closed.

Now let \(C\) be closed and suppose \((x_n)\) is a sequence in \(f^{-1}(C)\) converging to \(x\). Thus \(x_n^2\in C\) for every \(n\). We show \(x_n^2\to x^2\). Since \(x_n\to x\), eventually \(|x_n-x|<1\), and for those \(n\), \(|x_n+x|\leq |x_n-x|+2|x|<1+2|x|\). Consequently, \(|x_n^2-x^2|=|x_n-x||x_n+x|\leq (1+2|x|)|x_n-x|\), which tends to \(0\). By the metric closedness criterion, the limit \(x^2\) belongs to \(C\). Thus every convergent sequence in \(f^{-1}(C)\) has its limit in \(f^{-1}(C)\), so \(f^{-1}(C)\) is closed. Since \(C\) was arbitrary, the closed-set test proves that \(f\) is continuous.

Check with a particular closed set: For \(C=[2,3]\), the condition \(x^2\in C\) means \(2\leq x^2\leq3\), or equivalently \(\sqrt{2}\leq |x|\leq\sqrt{3}\). Therefore \(f^{-1}([2,3])=[-\sqrt{3},-\sqrt{2}]\cup[\sqrt{2},\sqrt{3}]\). Both endpoints in each interval are included because the inequalities defining \(C\) are non-strict. Squaring either endpoint gives \(2\) or \(3\), as required; values outside these intervals have square less than \(2\) or greater than \(3\).

Worked Example: The Topology on the Domain Matters

Let the domain be \(\mathbb{R}\) with the discrete topology, in which every subset is open, and let the target be \(\mathbb{R}\) with its standard topology. Consider the identity function \(f(x)=x\). If \(C\) is any closed subset of the standard real line, then \(f^{-1}(C)=C\) as a set. Every subset of the discrete domain is closed as well: its complement is a subset, hence open. Therefore the preimage of every closed target set is closed in the domain, and the closed-set test proves continuity.

Check: For \(C=[0,1]\), the preimage is \([0,1]\). It is closed in the discrete domain because its complement is open there. The argument works for every closed \(C\), not just this interval. The same formula \(f(x)=x\) with the standard topology also on the domain would require a different check; continuity is a property of a map together with the topologies on its domain and target.

Finding Discontinuity with One Closed Set

Worked Example: A Step Map

Give \(\mathbb{R}\) its standard topology in both domain and target. Define \(g:\mathbb{R}\to\mathbb{R}\) by \(g(x)=0\) when \(x\leq0\), and \(g(x)=1\) when \(x>0\). The singleton \(C=\{1\}\) is closed in the target: its complement is the open set \((-\infty,1)\cup(1,\infty)\). Directly from the definition of \(g\), \(g^{-1}(C)=(0,\infty)\).

This preimage is not closed in the standard real line. Indeed, the sequence \(1/n\), for \(n\in\mathbb{N}\), lies in \((0,\infty)\) and converges to \(0\), but \(0\notin(0,\infty)\). The metric closedness criterion therefore shows that \((0,\infty)\) is not closed. Since one closed set has a preimage that is not closed, the closed-set test proves that \(g\) is not continuous.

Check: For each \(n\in\mathbb{N}\), \(1/n>0\), so \(g(1/n)=1\). Also \(g(0)=0\). The sequence of inputs tends to \(0\), while the selected preimage omits \(0\), confirming the failure of closedness.

A Common Pitfall

Common mistake: When computing the preimage of \([2,3]\) under \(f(x)=x^2\), one might write only \([\sqrt{2},\sqrt{3}]\). This misses negative inputs, even though squaring them also gives values in \([2,3]\). The complete calculation begins with \(2\leq x^2\leq3\), which is equivalent to \(\sqrt{2}\leq |x|\leq\sqrt{3}\). Splitting according to the sign of \(x\) gives \(f^{-1}([2,3])=[-\sqrt{3},-\sqrt{2}]\cup[\sqrt{2},\sqrt{3}]\). The result includes both negative and positive inputs, with endpoints included.

There is a second logical pitfall: even a correctly computed, closed preimage for one closed set does not prove continuity. For example, the step map has \(g^{-1}(\{0\})=(-\infty,0]\), which is closed, but \(g^{-1}(\{1\})=(0,\infty)\), which is not. The theorem requires closed preimages for every closed target set. That universal condition proves continuity; failure at even one set disproves it.

Takeaway: To prove continuity with closed sets, start with an arbitrary closed \(C\subseteq Y\) and show \(f^{-1}(C)\) is closed in \(X\). To disprove continuity, it is enough to find one closed \(C\) whose preimage is not closed.

Check Your Understanding

Use the closed-set test in each question, keeping the domain and target topologies explicit.

  1. For a constant map \(f:X\to Y\) with value \(y_0\), compute \(f^{-1}(C)\) in the cases \(y_0\in C\) and \(y_0\notin C\).
  2. For \(f(x)=x^2\) on the standard real line, compute the preimage of \([1,4]\), including both negative and positive inputs.
  3. Let \(\mathbb{R}\) have the discrete topology in the domain and the standard topology in the target. Explain why the identity function is continuous.
  4. For the step map in the tutorial, identify a closed target set that witnesses discontinuity and verify its preimage.
  5. Why does checking that the preimage of one closed set is closed not establish continuity?