Tutorials › Real Analysis › Continuity and Closed Sets

Continuity · Tutorial 358 of 1000

Continuity and Closed Sets

Use closed preimages to test continuity and understand why the domain’s relative topology matters.

Intermediate 9 min read

What You'll Learn

  • Define a set closed relative to a function’s domain
  • Prove that continuous functions have closed preimages of closed sets
  • Characterize continuity by preimages of closed sets
  • Apply the criterion to polynomial and identity functions
  • Distinguish closed preimages from images of closed sets

Continuity and Closedness

Continuity can be described not only by how function values behave near each input, but also by what happens to sets under inverse images. In particular, when a function is continuous, the inverse image of a closed set is closed in its domain. The phrase “in its domain” matters: the domain may itself be only part of the real line, so closedness must sometimes be understood relative to that domain.

This viewpoint gives both a consequence of continuity and a way to recognize it. We will prove that continuous functions pull closed sets back to closed sets, then show that this property characterizes continuity. The inverse image of a set \(F\) under \(f\) is the set of inputs whose values lie in \(F\); it is written \(f^{-1}(F)\). It does not require \(f\) to have an inverse function.

Definition (Relatively Closed Set): Let \(E\subseteq\mathbb{R}\). A set \(A\subseteq E\) is closed relative to \(E\), or closed in \(E\), if it contains every limit in \(E\) of a convergent sequence of points from \(A\). More precisely, if \(x_n\in A\), \(x_n\to x\), and \(x\in E\), then \(x\in A\). Equivalently, \(E\setminus A\) is open relative to \(E\).

The restriction that the limit belong to \(E\) distinguishes relative closedness from closedness in all of \(\mathbb{R}\). For instance, \((0,1]\) is closed relative to \((0,2)\), even though it is not closed in \(\mathbb{R}\): the sequence \(1/n\) lies in \((0,1]\) and converges to \(0\), which is not in \((0,1]\), but \(0\) is also not in the domain \((0,2)\). There is no limit in the domain that violates relative closedness.

Continuous Functions Have Closed Preimages

The sequential criterion for continuity from earlier in this course is useful here. If \(x_n\to x\) within the domain and \(f\) is continuous at \(x\), then \(f(x_n)\to f(x)\). If all the values \(f(x_n)\) lie in a closed set, their limit must lie there as well. This is the essential reason closed sets behave well under inverse images.

Theorem (Closed Preimages Under Continuous Functions): Let \(E\subseteq\mathbb{R}\), let \(f:E\to\mathbb{R}\) be continuous, and let \(F\subseteq\mathbb{R}\) be closed. Then $$ f^{-1}(F)=\{x\in E:f(x)\in F\} $$ is closed relative to \(E\).

Proof. Let \((x_n)\) be a sequence in \(f^{-1}(F)\) that converges to some \(x\in E\). Since \(f\) is continuous at \(x\), the Sequential Criterion for Continuity gives \(f(x_n)\to f(x)\). For every \(n\), \(x_n\in f^{-1}(F)\), so \(f(x_n)\in F\). The set \(F\) is closed, and therefore contains the limit of every convergent sequence of its points. Hence \(f(x)\in F\), which means \(x\in f^{-1}(F)\). Every sequence from \(f^{-1}(F)\) that converges to a point of \(E\) thus has its limit in \(f^{-1}(F)\). By the sequential characterization of relative closedness, \(f^{-1}(F)\) is closed in \(E\). \(\square\)

The theorem concerns the preimage, not the image. A continuous function need not send every closed set in its domain to a closed set in its codomain. These two operations on sets have different behavior, as we will see after the examples.

Worked Example: A Polynomial Preimage of a Singleton

Let \(f:\mathbb{R}\to\mathbb{R}\) be \(f(x)=x^2-5\), and take the closed set \(F=\{4\}\). To find the preimage, solve the defining condition:

$$ x\in f^{-1}(\{4\}) \quad\Longleftrightarrow\quad x^2-5=4 \quad\Longleftrightarrow\quad x^2=9 \quad\Longleftrightarrow\quad x=-3\text{ or }x=3. $$

Thus \(f^{-1}(\{4\})=\{-3,3\}\). The polynomial \(f\) is continuous on \(\mathbb{R}\), and \(\{4\}\) is closed, so the Closed Preimages Under Continuous Functions Theorem guarantees that the preimage is closed. The calculation confirms this directly: a finite set of real numbers such as \(\{-3,3\}\) is closed.

Worked Example: A Preimage of a Closed Interval

Consider \(g:\mathbb{R}\to\mathbb{R}\), \(g(x)=x^2\), and the closed set \(F=(-\infty,4]\). Since \(g\) is a polynomial, it is continuous. The preimage is found by solving an inequality:

$$ x\in g^{-1}((-\infty,4]) \quad\Longleftrightarrow\quad x^2\leq 4 \quad\Longleftrightarrow\quad -2\leq x\leq 2. $$

Therefore \(g^{-1}((-\infty,4])=[-2,2]\), a closed subset of \(\mathbb{R}\), as the theorem predicts. The endpoints are included because the target set includes \(4\), and \(g(-2)=(-2)^2=4\) and \(g(2)=2^2=4\).

Worked Example: Relative Closedness on a Restricted Domain

Let \(E=(0,3)\), let \(h:E\to\mathbb{R}\) be the identity function \(h(x)=x\), and choose \(F=(-\infty,1]\). The set \(F\) is closed in \(\mathbb{R}\), and \(h\) is continuous on \(E\). Its preimage is

$$ h^{-1}((-\infty,1]) = \{x\in(0,3):x\leq1\} = (0,1]. $$

This set is closed relative to \(E\), as the theorem guarantees. To check this using sequences, suppose \(x_n\in(0,1]\), \(x_n\to x\), and \(x\in(0,3)\). Since \(x_n\leq1\) for every \(n\), the limit satisfies \(x\leq1\). Since \(x\in(0,3)\), it also satisfies \(x>0\), so \(x\in(0,1]\). The relative-domain condition is essential: \(x_n=1/n\) lies in \((0,1]\) and converges to \(0\), but \(0\notin(0,3)\), so this sequence does not contradict closedness relative to \(E\).

The Closed-Set Criterion for Continuity

The closed-preimage theorem has a converse. If the preimage of every closed subset of \(\mathbb{R}\) is closed relative to the domain, then the function must be continuous. Together, the two directions give a set-based characterization of pointwise continuity throughout any domain \(E\subseteq\mathbb{R}\).

Theorem (Closed-Set Criterion for Continuity): Let \(E\subseteq\mathbb{R}\) and \(f:E\to\mathbb{R}\). Then \(f\) is continuous on \(E\) if and only if \(f^{-1}(F)\) is closed relative to \(E\) for every closed set \(F\subseteq\mathbb{R}\).

Proof. If \(f\) is continuous on \(E\), then the Closed Preimages Under Continuous Functions Theorem shows that \(f^{-1}(F)\) is closed relative to \(E\) for every closed \(F\subseteq\mathbb{R}\).

For the converse, suppose \(f^{-1}(F)\) is closed relative to \(E\) for every closed \(F\subseteq\mathbb{R}\). We show that \(f\) is continuous at each \(a\in E\). Suppose, to the contrary, that \(f\) is not continuous at some \(a\in E\). By the epsilon-delta definition, there is an \(\varepsilon_0>0\) such that for every \(\delta>0\) there is an \(x\in E\) with

$$ |x-a|<\delta \quad\text{and}\quad |f(x)-f(a)|\geq\varepsilon_0. $$

For each positive integer \(n\), apply this statement with \(\delta=1/n\) to choose \(x_n\in E\) such that \(|x_n-a|<1/n\) and \(|f(x_n)-f(a)|\geq\varepsilon_0\). Then \(x_n\to a\). Define

$$ F=\{y\in\mathbb{R}:|y-f(a)|\geq\varepsilon_0\}. $$

This set is closed: it is the union of the two closed rays \((-\infty,f(a)-\varepsilon_0]\) and \([f(a)+\varepsilon_0,\infty)\). The inequalities for \(x_n\) show that \(f(x_n)\in F\), so \(x_n\in f^{-1}(F)\) for every \(n\). By the hypothesis, \(f^{-1}(F)\) is closed relative to \(E\). Since \(x_n\to a\) and \(a\in E\), relative closedness implies \(a\in f^{-1}(F)\), or \(f(a)\in F\). But \(|f(a)-f(a)|=0<\varepsilon_0\), so \(f(a)\notin F\). This contradiction proves that \(f\) is continuous at \(a\). Since \(a\) was arbitrary, \(f\) is continuous on \(E\). \(\square\)

Worked Example: Detecting a Discontinuity with a Closed Set

Define \(q:\mathbb{R}\to\mathbb{R}\) by \(q(x)=0\) when \(x\leq0\), and \(q(x)=1\) when \(x>0\). Consider the closed set \(F=\{1\}\). Its preimage is

$$ q^{-1}(\{1\})=(0,\infty). $$

This preimage is not closed in \(\mathbb{R}\): the sequence \(1/n\) belongs to \((0,\infty)\) and converges to \(0\), which is not in \((0,\infty)\). The Closed-Set Criterion therefore shows that \(q\) is not continuous on \(\mathbb{R}\). Directly, the failure occurs at \(0\), since \(q(0)=0\) while \(q(1/n)=1\) for every positive integer \(n\).

Why the Direction Matters

A common mistake is to reverse the closed-preimage theorem and conclude that a continuous function maps closed sets to closed sets. Continuity guarantees that the preimage of a closed set is closed relative to the domain; it does not generally guarantee that the image of a closed set is closed in the codomain. For example, \(r(x)=e^x\) is continuous on \(\mathbb{R}\), and \(\mathbb{R}\) is closed in itself, but \(r(\mathbb{R})=(0,\infty)\) is not closed in \(\mathbb{R}\), since positive numbers can converge to \(0\).

The closed-set criterion is useful when solving equations or inequalities involving a continuous function. If the target condition is \(f(x)\in F\) for a closed set \(F\), then the set of solutions is closed relative to the domain. It also provides an alternative way to prove continuity: rather than work directly with epsilon and delta at every point, one may sometimes identify the preimages of closed sets and verify their relative closedness.

Keep the domain in view when applying either result. A preimage can be closed in \(E\) without being closed in all of \(\mathbb{R}\), as the identity example on \((0,3)\) showed. Relative closedness asks whether limits that remain inside the domain are included; it does not require including limit points that lie outside the domain.

Check Your Understanding

Use the definitions and results in this tutorial to answer the following questions.

  1. What does it mean for a set to be closed relative to a domain \(E\)?
  2. Why does continuity imply that the preimage of a closed set is relatively closed?
  3. In the Closed-Set Criterion, what closed set is used to contradict a discontinuity at \(a\)?
  4. Why is \((0,1]\) closed relative to \((0,3)\) but not closed in \(\mathbb{R}\)?
  5. Why does continuity not guarantee that the image of a closed set is closed?