Tutorials › Real Analysis › Continuity Between Metric Spaces

Metric Spaces · Tutorial 675 of 1000

Continuity Between Metric Spaces

Understand continuity between metric spaces through open sets and convergent sequences, and use these characterizations to analyze examples and compositions.

Advanced 10 min read

What You'll Learn

  • Define continuity at a point using open neighborhoods in the domain and codomain
  • Relate pointwise continuity to inverse images of open sets
  • Prove the sequential characterization of continuity
  • Test continuity and discontinuity using convergent sequences
  • Establish that the composition of continuous maps is continuous
  • Recognize how the choice of metrics affects continuity

Continuity as Preservation of Nearby Points

In earlier tutorials, convergence and open sets were developed for metric spaces, and separability was connected to countable bases. Continuity brings these ideas together: a map is continuous when points sufficiently close to a given input have images close to the corresponding output. In metric spaces, this idea can be expressed using open sets or using convergent sequences. Both formulations will be useful, and each reveals a different aspect of continuity.

Let \((X,d_X)\) and \((Y,d_Y)\) be metric spaces, and let \(f:X\to Y\). An open set in \(Y\) can serve as a region of acceptable outputs. Continuity at a point says that there is an open region around the input whose points all map into that chosen output region.

Definition: The function \(f:X\to Y\) is continuous at \(x\in X\) if, for every open set \(V\subseteq Y\) with \(f(x)\in V\), there is an open set \(U\subseteq X\) such that \(x\in U\) and \(f(U)\subseteq V\). The function is continuous if it is continuous at every point of \(X\).

This definition is phrased in terms of open sets, but balls make its meaning concrete. Since \(V\) is open and contains \(f(x)\), it contains some ball centered at \(f(x)\). The condition asks for an open region around \(x\) whose image stays within that ball. The next tutorial will give a direct metric formulation of this requirement using prescribed radii.

There is also a global version. For a subset \(V\subseteq Y\), the inverse image is \(f^{-1}(V)=\{x\in X:f(x)\in V\}\). Continuity can be characterized by what happens to inverse images of open sets.

Definition: A function \(f:X\to Y\) is continuous in the open-set sense if \(f^{-1}(V)\) is open in \(X\) for every open set \(V\subseteq Y\).
Theorem (Pointwise and Open-Set Continuity): A function between metric spaces is continuous at every point if and only if the inverse image of every open set is open.

Proof. Suppose first that \(f\) is continuous at every point, and let \(V\subseteq Y\) be open. If \(x\in f^{-1}(V)\), then \(f(x)\in V\). Continuity at \(x\) gives an open set \(U_x\subseteq X\) with \(x\in U_x\) and \(f(U_x)\subseteq V\). Consequently, \(U_x\subseteq f^{-1}(V)\). Every point of \(f^{-1}(V)\) therefore has an open set around it contained in \(f^{-1}(V)\), so \(f^{-1}(V)\) is open. This also holds if \(f^{-1}(V)\) is empty, since the empty set is open.

Conversely, suppose the inverse image of every open subset of \(Y\) is open in \(X\). Fix \(x\in X\), and let \(V\subseteq Y\) be open with \(f(x)\in V\). The set \(f^{-1}(V)\) is open by assumption and contains \(x\). Taking \(U=f^{-1}(V)\), we have \(x\in U\) and \(f(U)\subseteq V\). This is continuity at \(x\). Since \(x\) was arbitrary, \(f\) is continuous everywhere. \(\square\)

The theorem explains why the two definitions express the same idea. Pointwise continuity controls the image of a suitably chosen region around each input. The open-set formulation collects those local statements into one condition about inverse images.

Continuity and Sequences

A second characterization uses only convergent sequences. It is particularly convenient when a map has a simple effect on distances or when a candidate discontinuity can be tested by approaching a point along a sequence.

Theorem (Sequential Characterization of Continuity): Let \(f:X\to Y\) be a function between metric spaces and let \(x\in X\). Then \(f\) is continuous at \(x\) if and only if, for every sequence \((x_n)\) in \(X\) with \(x_n\to x\), the sequence \(f(x_n)\) converges to \(f(x)\).

Proof. Suppose \(f\) is continuous at \(x\), and let \(x_n\to x\). To show that \(f(x_n)\to f(x)\), take any open set \(V\subseteq Y\) containing \(f(x)\). By continuity at \(x\), there is an open set \(U\subseteq X\) with \(x\in U\) and \(f(U)\subseteq V\). Since \(U\) is open and contains \(x\), it contains a ball \(B_r(x)\) for some \(r>0\). Convergence \(x_n\to x\) implies that \(x_n\in B_r(x)\subseteq U\) for all sufficiently large \(n\). Thus \(f(x_n)\in V\) for all sufficiently large \(n\). In particular, taking \(V\) to be any ball centered at \(f(x)\) proves \(f(x_n)\to f(x)\).

For the converse, suppose \(f\) is not continuous at \(x\). Then there is an open set \(V\subseteq Y\) containing \(f(x)\) such that no open set \(U\subseteq X\) containing \(x\) satisfies \(f(U)\subseteq V\). For each positive integer \(n\), the ball \(B_{1/n}(x)\) is an open set containing \(x\). Hence it contains some point \(x_n\) for which \(f(x_n)\notin V\). We have

$$ d_X(x_n,x)<\frac{1}{n}, $$

so \(x_n\to x\). But \(f(x_n)\notin V\) for every \(n\). Since \(V\) is open and contains \(f(x)\), convergence to \(f(x)\) would require \(f(x_n)\) to belong to \(V\) eventually: \(V\) contains a ball around \(f(x)\), and convergence eventually places the sequence in that ball. This contradiction shows that \(f\) must be continuous at \(x\). \(\square\)

The proof also gives a useful way to demonstrate failure of continuity. It is enough to find one sequence approaching \(x\) whose images do not approach \(f(x)\). The sequence need not be the only way to approach \(x\); one failing sequence already rules out continuity.

Worked Examples

Worked Example: A Constant Map

Let \(X\) and \(Y\) be metric spaces, choose \(c\in Y\), and define \(f:X\to Y\) by \(f(x)=c\) for every \(x\in X\). Let \(V\subseteq Y\) be open. Its inverse image is

$$ f^{-1}(V)= \begin{cases} X, & c\in V,\\ \varnothing, & c\notin V. \end{cases} $$

Both \(X\) and the empty set are open, so every open set in \(Y\) has an open inverse image. The Pointwise and Open-Set Continuity Theorem shows that \(f\) is continuous. Equivalently, every sequence in \(X\) has the constant image sequence \(c,c,\ldots\), which converges to \(c=f(x)\) at any chosen input \(x\).

Worked Example: The Inclusion of a Subspace

Let \(A\subseteq X\), give \(A\) the restricted metric, and consider the inclusion map \(i:A\to X\) defined by \(i(a)=a\). If \(V\) is open in \(X\), then

$$ i^{-1}(V)=V\cap A. $$

By the definition of the subspace topology, \(V\cap A\) is open in \(A\). Thus every open set in \(X\) has an open inverse image under \(i\), and the inclusion is continuous. This example makes an important distinction visible: openness is relative to the space being considered. A set can be open in the subspace \(A\) without being open in the ambient space \(X\).

Worked Example: The Absolute-Value Function

Define \(f:\mathbb{R}\to\mathbb{R}\) by \(f(x)=|x|\), with the usual metric on each copy of \(\mathbb{R}\). The triangle inequality gives \(|u|\leq |u-v|+|v|\), and interchanging \(u\) and \(v\) gives \(|v|\leq |u-v|+|u|\). Therefore

$$ \bigl||u|-|v|\bigr|\leq |u-v|. $$

Now let \(x_n\to x\). Substituting \(u=x_n\) and \(v=x\) into this inequality gives

$$ \bigl||x_n|-|x|\bigr|\leq |x_n-x|\longrightarrow 0. $$

Hence \(|x_n|\to |x|\). The Sequential Characterization of Continuity proves that \(f\) is continuous at every real number.

Worked Example: A Discontinuous Step Function

Define \(g:\mathbb{R}\to\mathbb{R}\) by \(g(x)=0\) when \(x<0\) and \(g(x)=1\) when \(x\geq 0\). Consider the sequence \(x_n=-1/n\). Since \(|x_n-0|=1/n\to 0\), we have \(x_n\to 0\). But \(g(x_n)=0\) for every \(n\), whereas \(g(0)=1\). The image sequence is constantly zero and does not converge to \(1\), since its distance from \(1\) is always \(1\). The Sequential Characterization of Continuity shows that \(g\) is not continuous at \(0\).

This test identifies a failure at a particular point. It makes no claim about continuity at other points; for example, the same function is constant on each of the intervals \((-\infty,0)\) and \((0,\infty)\).

Composition and the Role of the Metric

Continuity is stable under composition. This is essential when a complicated map is built from simpler maps: if each stage is continuous, the entire construction remains continuous.

Theorem (Composition of Continuous Maps): Let \(f:X\to Y\) and \(g:Y\to Z\) be continuous maps between metric spaces. Then \(g\circ f:X\to Z\) is continuous.

Proof. Let \(W\subseteq Z\) be open. Since \(g\) is continuous, \(g^{-1}(W)\) is open in \(Y\). Since \(f\) is continuous, the inverse image under \(f\) of this open set is open in \(X\). Inverse images under compositions satisfy

$$ (g\circ f)^{-1}(W)=f^{-1}\bigl(g^{-1}(W)\bigr). $$

Therefore \((g\circ f)^{-1}(W)\) is open in \(X\). The Pointwise and Open-Set Continuity Theorem implies that \(g\circ f\) is continuous. \(\square\)

A common pitfall is to treat continuity as a property of a formula alone. It depends on the metrics, because the metrics determine which sets are open and which sequences converge. The earlier theorem “A Bounded Distance with the Same Convergence” gives one useful illustration. If \(d\) is a metric and \(\rho(x,y)=d(x,y)/(1+d(x,y))\), then \(d\) and \(\rho\) have the same convergent sequences. The identity map in either direction between these metric spaces is continuous by the Sequential Characterization of Continuity. This conclusion uses the established convergence result; it does not say that arbitrary changes of metric preserve continuity.

The open-set and sequential perspectives complement one another. Inverse images are often efficient for proving global continuity and for handling compositions. Sequences are often efficient for checking continuity at a point or constructing a counterexample. In metric spaces, the two methods agree exactly, as the two characterization theorems show.

Takeaway: A map between metric spaces is continuous precisely when inverse images of open sets are open, or equivalently when it preserves limits of sequences at each point. Compositions of continuous maps are continuous, while a single sequence with incorrect image limit disproves continuity at a point.

Check Your Understanding

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

  1. What open-set condition defines continuity at a point \(x\)?
  2. Why does pointwise continuity imply that inverse images of open sets are open?
  3. How does the proof of the sequential characterization construct a sequence when continuity fails?
  4. Why is the inclusion map from a subspace into its ambient metric space continuous?
  5. What sequence demonstrates that the step function in the worked example is discontinuous at zero?
  6. How does the open-set characterization prove that a composition of continuous maps is continuous?