2.4 Continuity and Compactness

Theorem 2.4.1. Suppose \(f\) is a continuous function from a compact set \(X\subseteq \mathbb {R}\) into \(Y\subseteq \mathbb {R}\). Then \(f(X)\) is compact; that is, the continuous image of a compact set is compact.

Proof. Let \(\{G_i : i\in I\}\) be an open covering of \(f(X)\). For each \(i\), the set \(f^{-1}(G_i)\) is open in \(X\), since \(G_i\cap Y\) is open in \(Y\) and \(f\) is continuous. So \(f^{-1}(G_i) = X\cap O_i\) for some open set \(O_i\subseteq \mathbb {R}\). Every \(x\in X\) has \(f(x)\) in some \(G_i\), so the sets \(O_i\) form an open covering of \(X\). Since \(X\) is compact, finitely many of them, say \(O_1,\dots ,O_n\), cover \(X\). Then every \(x\in X\) lies in some \(f^{-1}(G_i)\) with \(1\leq i\leq n\), so \[f(X) \subseteq G_1\cup G_2\cup \dots \cup G_n .\] Thus every open covering of \(f(X)\) has a finite subcovering, and \(f(X)\) is compact. □

Corollary 2.4.2. Let \(f\) be a continuous function from a compact set \(X\subseteq \mathbb {R}\) into \(Y\subseteq \mathbb {R}\). Then \(f(X)\) is a bounded and closed subset of \(\mathbb {R}\).

Proof. By the theorem \(f(X)\) is compact, and by the Heine–Borel Theorem a compact subset of \(\mathbb {R}\) is bounded and closed. □

Theorem 2.4.3. Suppose \(f\) is a continuous real valued function on a non-empty compact set \(X\). Then there exist points \(p, q\in X\) such that \[f(p) = \sup \{ f(x): x \in X\} \qquad \text {and}\qquad f(q) = \inf \{f(x): x\in X\}.\]

Proof. By the theorem above, \(f(X)\) is a non-empty compact set of real numbers. By the corollary to the Heine–Borel Theorem it has a largest element \(M\) and a smallest element \(m\). Since \(M,m\in f(X)\), we have \(M = f(p)\) and \(m = f(q)\) for some \(p, q\in X\). □

Remark. The proof that the continuous image of a compact set is compact used no special property of \(\mathbb {R}\), only open coverings. That is why the statement, and with it the extreme value theorem, carries over unchanged to general topological spaces.

Theorem 2.4.4. Suppose \(f\) is a continuous one-one function from a compact set \(X\subseteq \mathbb {R}\) onto \(Y\subseteq \mathbb {R}\). Then the inverse function \(g = f^{-1}\), defined by \(g(f(x)) = x\) for \(x\in X\), is continuous on \(Y\).

Proof. By the corollary on closed sets, it suffices to show that \(g^{-1}(C) = f(C)\) is closed in \(Y\) for every set \(C\) closed in \(X\). Such a set is \(C = X\cap F\) with \(F\) closed in \(\mathbb {R}\); since \(X\) is closed and bounded, so is \(C\), and \(C\) is therefore compact by the Heine–Borel Theorem. By the theorem above, \(f(C)\) is compact, hence closed in \(\mathbb {R}\), and so \(f(C) = Y\cap f(C)\) is closed in \(Y\). Hence \(g\) is continuous. □

Example 2.4.5. Find the image of \(f(x) = \frac {1}{1+x^2}\) on \([-3,3]\) and on \(\mathbb {R}\), and explain the difference.

Solution. The function is even, decreasing on \([0,\infty )\), with \(f(0) = 1\) and \(f(3) = \frac {1}{10}\). So \(f([-3,3]) = \left [\frac {1}{10},1\right ]\), a compact interval, as the theorems of this section predict.

On \(\mathbb {R}\), \(f(x)\) takes every value in \((0,1]\) but never \(0\), since \(f(x)>0\) and \(f(x)\longrightarrow 0\) as \(|x|\longrightarrow \infty \). So \(f(\mathbb {R}) = (0,1]\), which is not compact: the infimum \(0\) is not attained. Nothing is contradicted, because \(\mathbb {R}\) is not compact.

Example 2.4.6. Show that compactness of the domain is needed in the theorem on continuous inverses: give a continuous bijection whose inverse is not continuous.

Solution. Let \(X = [0,1)\cup [2,3]\) and define \(f: X\longrightarrow [0,2]\) by \(f(x) = x\) on \([0,1)\) and \(f(x) = x-1\) on \([2,3]\). Then \(f\) is continuous on \(X\), one-one, and onto \([0,2]\). Its inverse is \(g(y) = y\) for \(0\leq y<1\) and \(g(y) = y+1\) for \(1\leq y\leq 2\). As \(y\longrightarrow 1^-\), \(g(y)\longrightarrow 1\), but \(g(1) = 2\). So \(g\) is not continuous at \(1\). The domain \(X\) is not compact, because it is not closed.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.