As usual, this post can be viewed as a PDF.
Theorem (Boundedness Theorem). A continuous realvalued function on a closed interval is bounded.
Proof. Suppose f is such a function and [a, b] is its domain. First, observe that for every c ∈ [a, b], since f is continuous at c, there is a positive such that for every x ∈ [a, b]∩(c − δ, c + δ), we have f(x)∈(f(c)−1, f(c)+1). So there is a neighbourhood of c, namely (c − δ, c + δ), on which f is bounded. Thus f is, in a sense, locally bounded at every point in its domain; the problem is to prove that this local boundedness implies global boundedness.
In textbook proofs of the boundedness theorem, this is generally done using what I would regard as a trick, such as supposing f isn’t bounded and using the BolzanoWeierstrass theorem to obtain a contradiction. More advanced texts may appeal to the compactness of [a, b], but the proof that [a, b] is compact (the HeineBorel theorem) amounts to basically the same logic, and is usually no less trickful^{1}.
However, if we think about how to construct an algorithm to find a global bound (often a helpful move to make—the unsituatedintimeness of ordinary mathematical language can be quite thoughtlimiting) then there is a procedure which, in my opinion, is quite obvious and immediately suggests itself. Just start on the left, with the singleton interval {a}, on which f is certainly bounded, and repeatedly apply local boundedness to the right endpoint, gradually expanding the subinterval of [a, b] on which we know f to be bounded. At each step the existing subinterval has a bound, and the neighbourhood of the right endpoint has a bound; taking the maximum of these two bounds gives us a bound of the whole expanded subinterval formed by unioning^{2} the neighbourhood with the existing subinterval. Eventually the right endpoint will reach b and we will no longer be able to expand it further, at which point we stop and observe that we have bounded the whole of [a, b]. (Sanity check: why would this fail for (a, b)? Because then we wouldn’t be able to take the right endpoint to b; there would be nowhere to stop the procedure, without leaving a part of the right of (a, b) unbounded.)
Of course, this algorithm will not in general terminate in a finite number of steps, but this is no issue; don’t let your thinking be limited by the arbitrary limitations of physical machines. Obviously, it is still necessary to prove that this algorithm will terminate, even if it takes infinitely many steps. Since we’re now dealing with the distinctions among the infinite quantities, we’re going to need to use some settheoretic machinery (which is why you won’t see this proof in introductory real analysis textbooks). I’ll assume that you are familiar with the ordinals, the techniques of transfinite induction and recursion, and BuraliForti’s paradox (which says that there is no set of all ordinals).
Here’s the plan. Using transfinite recursion, we shall construct an ordinalindexed sequence ⟨x_{α}⟩ of members of [a, b] such that every ordinal α has the following properties:
 The function f is bounded on [a, x_{α}].
 We have x_{α} ≤ x_{α + 1}, and if x_{α} = x_{α + 1}, then x_{α + 1} = b.
Then, since there are a proper class’s worth of ordinals and [a, b] is just a set, the sequence ⟨x_{α}⟩ will have to repeat^{3}, so there will be ordinals α and β such that α < β and x_{α} = x_{β}. By (2), the sequence ⟨x_{α}⟩ will be nondecreasing, so we will have x_{α} ≤ x_{α + 1} ≤ x_{β} and hence x_{α} = x_{α + 1} = x_{β} = b. Then by (1), it will follow that f is bounded on [a, b].
All we need to do to complete the proof is describe the recursion and make it clear that it is a valid recursion (i.e. all of the assumed properties used to construct the next term of the sequence are preserved by the constructed sequence with the next term added).
 Base case
 Let x_{0} = a and observe that f is bounded on {a} by f(a).
 Successor case
 For every ordinal α, if we assume that x_{α} ∈ [a, b], then since f is continuous, there is a positive such that f is bounded on [x_{α}, x_{α} + δ] by some M. Let x_{α + 1} = min(b, x_{α} + δ), and observe that:
 If b ≤ x_{α} + δ, then x_{α + 1} = b and hence a ≤ x_{α} ≤ x_{α + 1} ≤ b. Otherwise, we have x_{α + 1} = x_{α} + δ and hence a ≤ x_{α} < x_{α + 1} ≤ b, with the middle inequality strict, so that we can only have x_{α} = x_{α + 1} when x_{α + 1} = b.

We have x_{α + 1} ≤ x_{α} + δ, so f is bounded by M on [x_{α}, x_{α + 1}] as well as [x_{α}, x_{α} + δ]. Assuming f is bounded on [a, x_{α}] by some L, it follows that f is bounded on [a, x_{α + 1}] by max(L, M).
 Limit case

For every limit ordinal λ, let A = {x_{α} : α < λ}. Then A contains x_{0} and hence is nonempty, and is bounded above by b, so it has a supremum. Let x_{λ} = supA, and observe that:
 If we assume that A ⊆ [a, b], then since A is nonempty and x_{λ} is ge every member of A, we have x_{λ} ≥ a; and since b bounds A above and x_{λ} is the smallest upper bound of A, we also have x_{λ} ≤ b.

Since x_{λ} ∈ [a, b] and f is continuous, there is a positive such that f is bounded on [x_{λ} − δ, x_{λ}] by some M. And since x_{λ} = supA, there is an ordinal α < λ such that x_{λ} − δ < x_{α} and hence f is bounded on [x_{α}, x_{λ}] by M. Assuming f is bounded on [a, x_{α}] by some L, it follows that f is bounded on [a, x_{λ}] by max(L, M).
And that’s it.
Of course, this proof is a bit tedious. There might be ways to make it shorter (maybe we can use Zorn’s lemma instead of transfinite induction). But the advantage it has over other proofs of the boundedness theorem I’ve seen is that it falls out more or less automatically, without requiring any flashes of insight.

This word doesn’t appear to exist currently, but it needs inventing.↩

Another word that needs inventing. OK, I could use “uniting”, but I suspect people wouldn’t immediately make the connection with the union operation on sets if I used that word.↩

This is a sort of infinitary pigeonhole principle.↩