Tutorials › Real Analysis › Continuity in Topological Spaces

Topology · Tutorial 723 of 1000

Continuity in Topological Spaces

Learn to test continuity through neighborhoods and to track how continuity behaves under composition, subspaces, and changes of topology.

Advanced 10 min read

What You'll Learn

  • Define continuity at a point without using a metric or distance
  • Distinguish continuity at one point from continuity on an entire space
  • Prove that compositions of continuous maps are continuous
  • Show that restricting a continuous map to a subspace preserves continuity
  • Determine how finer domain and coarser target topologies affect continuity
  • Test continuity in usual, cofinite, and indiscrete topologies

Continuity Without Distances

In metric spaces, continuity can be described by controlling the distance between inputs and outputs. Topological spaces need not have distances, so the basic test must use neighborhoods instead. The neighborhood language developed earlier in this course lets us ask the same essential question: can inputs sufficiently near a point be kept inside any prescribed neighborhood of its output?

Let \(f:X\to Y\) be a function between topological spaces. A neighborhood of a point is a set containing an open set that contains that point. Thus a neighborhood need not itself be open. To test continuity at \(x\in X\), we examine neighborhoods of \(f(x)\) and ask whether their preimages are neighborhoods of \(x\).

Definition: A function \(f:X\to Y\) is continuous at \(x\in X\) if, for every neighborhood \(V\) of \(f(x)\) in \(Y\), the preimage \(f^{-1}(V)\) is a neighborhood of \(x\) in \(X\). The function is continuous if it is continuous at every point of \(X\).

The definition can also be read in terms of images of neighborhoods. Continuity at \(x\) means that for every neighborhood \(V\) of \(f(x)\), there is a neighborhood \(U\) of \(x\) such that \(f[U]\subseteq V\). Indeed, if \(f^{-1}(V)\) is a neighborhood of \(x\), we can take \(U=f^{-1}(V)\); conversely, if such a \(U\) exists, then \(U\subseteq f^{-1}(V)\), so the preimage is a neighborhood of \(x\). This formulation emphasizes that the input neighborhood may depend on the output neighborhood.

Continuity at a Point and on a Space

Continuity is local in its definition: it is tested separately at each point of the domain. A function can be continuous at some points and fail to be continuous at others. In particular, continuity at one point makes no claim about behavior everywhere else.

Worked Example: A Function Continuous Away from One Point

Define \(f:\mathbb{R}\to\mathbb{R}\), with the usual topology on both spaces, by \(f(0)=0\) and \(f(x)=1\) when \(x\neq 0\). We check continuity using neighborhoods.

Fix \(a\neq 0\). The interval \(U=(a-|a|/2,a+|a|/2)\) does not contain \(0\): every \(x\in U\) satisfies \(|x-a|<|a|/2\), and hence \(|x|>|a|/2>0\). On \(U\), the function is constantly equal to \(1\). If \(V\) is any neighborhood of \(f(a)=1\), then \(1\in V\), so \(f[U]=\{1\}\subseteq V\). Thus \(f\) is continuous at \(a\).

At \(0\), consider the neighborhood \(V=(-1/2,1/2)\) of \(f(0)=0\). If \(U\) is any neighborhood of \(0\), it contains an open interval \((-\delta,\delta)\) for some \(\delta>0\). The point \(x=\delta/2\) belongs to \(U\), is nonzero, and satisfies \(f(x)=1\notin V\). Therefore no neighborhood \(U\) of \(0\) has \(f[U]\subseteq V\). The function is not continuous at \(0\), and so it is not continuous on \(\mathbb{R}\).

This example also illustrates why the neighborhood test concerns all output neighborhoods. A neighborhood that is too large to reveal a failure does not establish continuity; one failing neighborhood is enough to disprove continuity at a point.

Composition Preserves Continuity

One of the most useful rules in analysis is that continuous operations can be chained. The rule holds for arbitrary topological spaces and follows directly from the neighborhood definition.

Theorem: Let \(f:X\to Y\) and \(g:Y\to Z\) be functions between topological spaces. If \(f\) is continuous at \(x\in X\) and \(g\) is continuous at \(f(x)\), then \(g\circ f\) is continuous at \(x\). In particular, the composition of two continuous functions is continuous.

Proof. Let \(W\) be any neighborhood of \(g(f(x))\) in \(Z\). Since \(g\) is continuous at \(f(x)\), the set \(g^{-1}(W)\) is a neighborhood of \(f(x)\) in \(Y\). Since \(f\) is continuous at \(x\), the preimage \(f^{-1}(g^{-1}(W))\) is a neighborhood of \(x\) in \(X\). For every \(t\in X\), \(t\in f^{-1}(g^{-1}(W))\) exactly when \(f(t)\in g^{-1}(W)\), which holds exactly when \(g(f(t))\in W\). Therefore $$ f^{-1}(g^{-1}(W))=(g\circ f)^{-1}(W). $$ The preimage of every neighborhood \(W\) of \((g\circ f)(x)\) is consequently a neighborhood of \(x\). This proves continuity of \(g\circ f\) at \(x\). If \(f\) and \(g\) are continuous everywhere, the pointwise result applies at every \(x\in X\). \(\square\)

The pointwise version is useful when a full function is not continuous everywhere. If \(f\) is continuous at a particular \(x\), and \(g\) is continuous at the particular value \(f(x)\), their composition is still continuous at \(x\). No global continuity assumption is needed for that conclusion.

Worked Example: Continuity into the Cofinite Topology

Give \(\mathbb{R}\) its usual topology as a domain and the cofinite topology as a target. The cofinite topology consists of \(\varnothing\) and all sets whose complements are finite. Consider the identity function \(i:\mathbb{R}\to\mathbb{R}\), \(i(x)=x\).

Fix \(x\in\mathbb{R}\), and let \(V\) be a neighborhood of \(i(x)=x\) in the cofinite topology. There is a cofinite open set \(O\) with \(x\in O\subseteq V\). Write \(O=\mathbb{R}\setminus F\), where \(F\) is finite. A finite subset \(F\) of \(\mathbb{R}\) is closed in the usual topology, so \(O\) is open in the usual topology. It is therefore a neighborhood of \(x\) in the domain, and \(i[O]=O\subseteq V\). The neighborhood criterion proves that \(i\) is continuous at every \(x\).

The two topologies here are different, but the identity map is continuous in this direction. The cofinite target has relatively large neighborhoods, so it asks less of the map than the usual topology would. Reversing the roles of the topologies changes the continuity question.

Restricting a Continuous Function to a Subspace

If a function is continuous on a space, it remains continuous when its domain is restricted to a subset equipped with the subspace topology. The open neighborhoods in the subspace are formed by intersecting ambient open sets with that subset, which gives the needed neighborhood directly.

Theorem: Let \(f:X\to Y\) be continuous, and let \(A\subseteq X\) have the subspace topology. Then the restriction \(f|_A:A\to Y\) is continuous.

Proof. Fix \(a\in A\), and let \(V\) be a neighborhood of \(f(a)\) in \(Y\). Since \(f\) is continuous at \(a\), \(f^{-1}(V)\) is a neighborhood of \(a\) in \(X\). By the definition of neighborhood, there is an open set \(O\) in \(X\) such that \(a\in O\subseteq f^{-1}(V)\). The set \(A\cap O\) is open in the subspace \(A\) and contains \(a\). If \(t\in A\cap O\), then \(t\in f^{-1}(V)\), so \(f(t)\in V\). Hence $$ (f|_A)[A\cap O]\subseteq V. $$ Thus the preimage of \(V\) under \(f|_A\) is a neighborhood of \(a\) in \(A\). This holds for every \(a\in A\) and every neighborhood \(V\) of \(f(a)\), proving continuity of the restriction. \(\square\)

The inclusion map \(j:A\to X\), defined by \(j(a)=a\), is also continuous. For a neighborhood \(V\) of \(j(a)=a\) in \(X\), choose an open set \(O\) in \(X\) with \(a\in O\subseteq V\). Then \(A\cap O\) is a neighborhood of \(a\) in \(A\), and \(j[A\cap O]\subseteq V\). This observation, together with the composition theorem, is another way to see why restricting the domain causes no difficulty.

How the Domain and Target Topologies Matter

Continuity depends on both topologies, not just on the underlying function. Making the domain topology finer gives more open sets and therefore more neighborhoods available for the continuity test. Making the target topology coarser gives fewer open sets and fewer neighborhood requirements to check. The following precise comparison captures these effects.

Theorem: Let \(\mathcal{T}_X\subseteq\mathcal{T}'_X\) be two topologies on \(X\), and let \(\mathcal{T}'_Y\subseteq\mathcal{T}_Y\) be two topologies on \(Y\). If \(f:(X,\mathcal{T}_X)\to(Y,\mathcal{T}_Y)\) is continuous, then \(f:(X,\mathcal{T}'_X)\to(Y,\mathcal{T}'_Y)\) is continuous.

Proof. Fix \(x\in X\) and take a neighborhood \(V\) of \(f(x)\) in \((Y,\mathcal{T}'_Y)\). There is a \(\mathcal{T}'_Y\)-open set \(O\) such that \(f(x)\in O\subseteq V\). Since \(\mathcal{T}'_Y\subseteq\mathcal{T}_Y\), \(O\) is also open in \((Y,\mathcal{T}_Y)\). Continuity for the original topologies implies that \(f^{-1}(O)\) is a neighborhood of \(x\) in \((X,\mathcal{T}_X)\). It contains a \(\mathcal{T}_X\)-open set \(G\) with \(x\in G\subseteq f^{-1}(O)\). Since \(\mathcal{T}_X\subseteq\mathcal{T}'_X\), \(G\) is open in \((X,\mathcal{T}'_X)\) as well. We have \(G\subseteq f^{-1}(O)\subseteq f^{-1}(V)\), so \(f^{-1}(V)\) is a neighborhood of \(x\) in the finer domain topology. This proves continuity for the new pair of topologies. \(\square\)

Worked Example: A Map That Fails into a Discrete Target

Give \(\mathbb{R}\) its usual topology in the domain and the discrete topology in the target, and consider the identity \(i(x)=x\). At any \(x\), the singleton \(\{x\}\) is an open neighborhood of \(i(x)\) in the discrete target. Its preimage is \(i^{-1}(\{x\})=\{x\}\).

A singleton is not a neighborhood of \(x\) in the usual topology: every open interval containing \(x\) also contains points other than \(x\). Thus \(i^{-1}(\{x\})\) is not a neighborhood of \(x\), and the identity map is not continuous. This agrees with the topology comparison theorem: replacing the usual target topology by the finer discrete topology is not one of the changes that guarantees continuity.

A Topology Can Make Continuity Asymmetric

Neighborhoods need not treat different points in the same way. This can make continuity at one point quite different from continuity at another, even when the function and its underlying sets are simple.

Worked Example: Continuity in the Sierpiński Space

Let \(X\) be an indiscrete space with at least two points, choose \(a\in X\), and define \(f:X\to\{0,1\}\) by \(f(a)=1\) and \(f(x)=0\) for \(x\neq a\). Give \(\{0,1\}\) the topology \(\{\varnothing,\{1\},\{0,1\}\}\), called the Sierpiński topology.

The only neighborhood of \(0\) in this target is \(\{0,1\}\). Therefore, at any \(x\neq a\), every target neighborhood of \(f(x)=0\) has preimage \(X\), which is a neighborhood of \(x\) in the indiscrete domain. The map is continuous at every \(x\neq a\).

At \(a\), the set \(\{1\}\) is a neighborhood of \(f(a)=1\). Its preimage is \(\{a\}\). The only open set in the indiscrete domain that contains \(a\) is \(X\), so \(\{a\}\) is not a neighborhood of \(a\) when \(X\) has at least two points. Hence \(f\) is not continuous at \(a\).

Why the Neighborhood Definition Matters

The neighborhood test is the general definition to keep in view when no metric is available. In a metric space, open balls give convenient neighborhood bases, and the continuity test can then be written using radii or distance inequalities. Those are useful forms of the same idea, but they depend on metric structure. The neighborhood definition applies just as well to cofinite, indiscrete, and other topologies.

A common pitfall is to judge continuity from the function’s formula alone, or to assume that a topology affects all points in a uniform way. The examples above show otherwise: the same identity function is continuous or discontinuous depending on its target topology, and the Sierpiński example has continuity at some points but not others. Always identify the domain topology, the target topology, and the neighborhoods that the definition requires you to test.

Check Your Understanding

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

  1. What must be true of \(f^{-1}(V)\) for every neighborhood \(V\) of \(f(x)\) if \(f\) is continuous at \(x\)?
  2. In the composition theorem, why does continuity of \(g\) at \(f(x)\) provide the input needed to apply continuity of \(f\) at \(x\)?
  3. Why does restricting a continuous function to a subspace preserve continuity?
  4. How does making the domain topology finer affect the neighborhood test for continuity?
  5. For the identity from the usual topology on \(\mathbb{R}\) to the discrete topology, which target neighborhood demonstrates failure of continuity?
  6. In the Sierpiński example, why is the function continuous at points other than \(a\), but not at \(a\)?