What it means to be connected
A space X is connected if it cannot be split into two nonempty disjoint open sets whose union is all of X. Such a split is called a separation; connected means no separation exists. Equivalently, the only subsets that are simultaneously open and closed (“clopen”) are ∅ and X itself. Intuitively, a connected space is in one piece — you cannot cut it cleanly along an open seam.
The basic fact about R is that its intervals are exactly its connected subsets. A set like {1} ∪ {2} is disconnected: the open sets (0, 1.5) and (1.5, 3) separate it. A related, stronger notion is path-connectedness: any two points can be joined by a continuous path inside the space. Path-connected always implies connected; for open subsets of Rⁿ the two coincide.
Continuous images, and the intermediate value theorem
Here is the single fact that does the work: a continuous map sends connected sets to connected sets. The proof is a clean contrapositive — if the image split into two open pieces, pulling them back through f⁻¹ would split the domain, contradicting its connectedness. The intermediate value theorem is then immediate, no longer a separate miracle but a corollary.
Lemma. If f : X -> Y is continuous and X is connected, then f(X) is connected.
Proof (contrapositive). Suppose f(X) is NOT connected: there are open sets
A, B in Y with
f(X) ⊆ A ∪ B, A ∩ f(X) ≠ ∅, B ∩ f(X) ≠ ∅, A ∩ B ∩ f(X) = ∅.
Then U = f^{-1}(A) and V = f^{-1}(B) are open in X (continuity), nonempty
(each part of the image is hit), disjoint, and U ∪ V = X.
That is a separation of X — contradicting that X is connected.
Hence f(X) is connected. ∎
Intermediate Value Theorem. Let f : [a, b] -> R be continuous and suppose
f(a) < y < f(b). Then f(c) = y for some c in [a, b].
Proof. [a, b] is connected (an interval), so by the Lemma f([a,b]) is a
connected subset of R, hence an interval. It contains f(a) and f(b),
so it contains every value between them, in particular y.
Thus y = f(c) for some c in [a, b]. ∎Compactness, and the extreme value theorem
Compactness plays the twin role. A continuous map sends compact sets to compact sets — given an open cover of the image, pull it back, take a finite subcover of the (compact) domain, and push forward. Combine this with Heine–Borel and you get the extreme value theorem: a continuous function on a compact set attains its maximum and minimum.
Extreme Value Theorem. A continuous f : [a, b] -> R attains a max and a min. Proof. 1. [a, b] is compact (Heine-Borel: closed and bounded). 2. The continuous image f([a,b]) is compact (compactness is preserved), so by Heine-Borel f([a,b]) is closed and bounded in R. 3. Bounded above => M = sup f([a,b]) exists and is finite. 4. M is a limit of values of f, so M ∈ closure of f([a,b]) = f([a,b]) (the set is closed). Hence M = f(c) for some c in [a, b]: the maximum is ATTAINED. 5. The same argument on -f, or using inf, gives the minimum. ∎ Where each hypothesis is used: - boundedness of [a,b] -> f is bounded (sup is finite); - closedness of [a,b] -> the sup is achieved, not just approached. Drop either and it fails: f(x)=x on (0,1) has sup 1 but no maximum.