The Extreme Value Theorem

1. Inverse Images of Open Sets

In keeping with the topological formulation of convergence, we can understand the notion of continuity in terms of the behavior of open sets. Specifically:
Theorem
Suppose that \(E \subset {\mathbb R}\) and \(f \ : \ E \rightarrow {\mathbb R}\). Then \(f\) is continuous at all points \(p \in E\) if and only if for every open set \(O \subset {\mathbb R}\), the inverse image
\[ f^{-1}(O) := \left\{p \in E \ : \ f(p) \in O \right\}\]
is relatively open, meaning that there exists an open set \(U \subset {\mathbb R}\) such that \(f^{-1}(O) = E \cap U\).
Proof
For the forward direction, let \(O\) be open and consider \(f^{-1}(O)\). Points \(p\) belong to \(f^{-1}(O)\) if and only if \(f(p) \in O\), and since \(O\) is open, any \(p \in f^{-1}(O)\) must have some neighborhood \(N_\epsilon(f(p))\) for some \(\epsilon > 0\) which is entirely contained in \(O\). By continuity at \(p\), there is some \(\delta\) such that every \(y \in N_\delta(p) \cap E\) satisfies \(|f(y) - f(p)| < \epsilon\), which is the same as saying that \(f(y) \in N_\epsilon(f(p))\) for every such \(y\). If we let \(U\) be the union of all neighborhoods \(N_\delta(p)\) which have \(f(N_\delta(p) \cap E) \subset O\), this set \(U\) is manifestly open and we have just seen that every \(p \in f^{-1}(O)\) will be contained in \(U\), i.e., \(f^{-1}(O) \subset U \cap E\) (we can intersect with \(E\) because \(f^{-1}(O) \subset E\)). But every point \(q \in U \cap E\) is necessarily in some neighborhood \(N_\delta(p)\) satisfying \(f(N_\delta(p) \cap E) \subset O\), so it follows that \(U \cap E \subset f^{-1}(O)\) and consequently \(U \cap E = f^{-1}(O)\).

For the reverse direction, Fix any \(p \in E\) and let \(O = N_\epsilon(f(p))\). There must exist some open set \(U\) such that \(f^{-1}(O) = E \cap U\). Since \(p \in f^{-1}(O)\), \(p \in U\); by openness of \(U\), there is some neighborhood \(N_\delta(p) \subset U\). Therefore, any \(y \in E\) with \(|y-p| < \delta\) will belong to \(E \cap U\) and consequently satisfy \(y \in f^{-1}(O)\), meaning \(f(y) \in O\) and therefore \(|f(y) - f(p)| < \epsilon\).
In short, continuous functions are those for which inverse images of open sets are relatively open.

By using the relationship that \(f^{-1}(O^c) = E \setminus f^{-1}(O)\), one can show the corresponding fact that \(f \ : \ E \rightarrow {\mathbb R}\) is continuous if and only if inverse images of closed sets are relatively closed (meaning they are the intersection of the domain \(E\) with a closed set).

2. Images of Compact Sets

The next key observation is that continuous functions preserve compactness as well; a key difference is that it is not the inverse image of compact sets which must be compact, but the image itself. This is because of the “backwards” relationship between compactness and openness.
Theorem
Suppose \(E \subset {\mathbb R}\) is compact and \(f \ : \ E \rightarrow {\mathbb R}\) is continuous; then the image \(f(E)\) is also compact.
Proof
Let \(\mathcal O\) be any open cover of \(f(E)\). Each \(O \in \mathcal O\) is open, so \(f^{-1}(O)\) is relatively open, i.e., \(f^{-1}(O) = U \cap E\) for some open set \(U\). Let \(\mathcal U\) be a collection of open sets in \({\mathbb R}\) containing such an open set \(U\) for each \(O \in \mathcal{O}\); i.e., \(U \in \mathcal U\) if and only if there is some \(O \in \mathcal O\) such that \(f^{-1}(O) = U \cap E\). Every point \(p \in E\) belongs to some \(U \in \mathcal U\) simply because \(f(p)\) always belongs to some \(O \in \mathcal O\) and therefore \(p\) necessarily belongs to the corresponding open set \(U\) for which \(f^{-1}(O) = U \cap E\). Since \(E\) is compact, there is a finite subcover \(\{U_1,\ldots,U_N\}\) which contains \(E\). We claim that this forces the corresponding open sets \(\{O_1,\ldots,O_N\} \subset \mathcal{O}\) to be a finite subcover of \(f(E)\). This is because every \(z \in f(E)\) has \(p \in E\) with \(f(p) = z\), and since \(p \in E\), \(p\) belongs to \(U_i\) for some \(i\). Consequently \(p \in E \cap U_i = f^{-1}(O_i)\), therefore \(z = f(p) \in O_i\) for the same \(i\).
As a side note, any function \(f \ : \ E \rightarrow {\mathbb R}\) which has the property that inverse images of compact sets are always compact is called a proper map. The function \(f(x):=x^2\) is proper, but the function \(g(x) := \frac{1}{1+x^2}\) is not.

3. Compact Sets and the Supremum/Infimum

Theorem (Compact sets contain their supremum and infimum)
Suppose \(E \subset {\mathbb R}\) is nonempty and compact. Then \(\sup E\) and \(\inf E\) belong to \(E\).
Proof
Since \(E\) is closed, if \(\sup E\) does not belong to \(E\), then there is some \(\delta > 0\) such that \(N_\delta(\sup E) \subset E^c\) (because \(E^c\) is open). In particular, this means that none of the real numbers \((\sup E - \delta, \sup E]\) belong to \(E\); consequently \(\sup E - \delta\) is an upper bound of the set \(E\), contradicting the properties of the supremum. The argument for the infimum works analogously.
An immediate corollary of the above observation is the Extreme Value Theorem which guarantees that continuous functions on compact domains always attain maximum and minimum values. This is to be contrasted with a function like \(\frac{1}{1+x^2}\) on the real line, which has values which tend to zero as \(x \rightarrow \pm \infty\) but never actually takes the value \(0\) at any point.
Corollary (Extreme Value Theorem)
If \(f \ : \ E \rightarrow {\mathbb R}\) is continuous and \(E\) is compact, then \(f\) attains its maximum and minimum values, i.e., there exist points \(a,b \in E\) such that \(f(a) = \inf_{y \in E} f(y)\) and \(f(b) = \sup_{y \in E} f(y)\). In other words, for all \(y \in E\), \(f(a) \leq f(y) \leq f(b)\).
Proof
Since \(f\) is continuous and \(E\) is compact, \(f(E)\) is compact, and it therefore contains its supremum and infimum. In other words, \(\sup f(E) \in f(E)\) and \(\inf f(E) \in f(E)\). Having the supremum and infimum belonging to \(f(E)\) means that each of these two values is attained at some point. In this case, it means that there exist \(a,b \in E\) such that \(f(a) = \inf f(E)\) and \(f(b) = \sup f(E)\). Consequently \(f(a) \leq f(y) \leq f(b)\) for all \(y \in E\). Choosing \(y = a\) or \(y=b\), respectively, shows that the inequalities cannot be strict.
Exercises
  1. Show that for any \(E \subset {\mathbb R}\), a function \(f \ : \ E \rightarrow {\mathbb R}\) is continuous if and only if \(f^{-1}(C)\) is relatively closed for all closed sets \(C \subset {\mathbb R}\).
  2. Prove that \(f(x):=x^2\) is proper and \(g(x) := \frac{1}{1+x^2}\) is not, where both are considered functions on \({\mathbb R}\).