Let
E={xβ[a,b]:fΒ isΒ boundedΒ aboveΒ onΒ [a,x]}.
We first show that E is nonempty. Since f is continuous at a in the sense of Continuity at a Point, there exists Ξ΄>0 such that for every xβ[a,b], if β£xβaβ£<Ξ΄, then
β£f(x)βf(a)β£<1.
Thus f(x)<f(a)+1 whenever xβ[a,min{a+Ξ΄,b}], so f is bounded above on that initial subinterval. Therefore Eξ =β
.
The set E is bounded above by b, so by Least Upper Bound Property of the Real Numbers there exists c=supE. We claim that c=b. Suppose instead that c<b. Because f is continuous at c, there exists Ξ΄cβ>0 such that for every xβ[a,b], if β£xβcβ£<Ξ΄cβ, then
β£f(x)βf(c)β£<1.
In particular, f(x)<f(c)+1 on (cβΞ΄cβ,c+Ξ΄cβ)β©[a,b]. Since c=supE, there exists yβE with cβΞ΄cβ/2<yβ€c. Because yβE, the function f is bounded above on [a,y]; say f(x)β€M there. It follows that f is bounded above on [a,c+Ξ΄cβ/2] by max{M,f(c)+1}. Hence c+Ξ΄cβ/2βE, contradicting the fact that c is an upper bound for E. Therefore c=b, and f is bounded above on [a,b].
Let
S=f([a,b])={f(x):xβ[a,b]}.
The set S is nonempty and bounded above, so Least Upper Bound Property of the Real Numbers gives a real number u=supS in the sense of Upper Bound and Least Upper Bound. For each integer nβ₯1, the number uβ1/n is not an upper bound for S, so there exists xnββ[a,b] such that
uβn1β<f(xnβ)β€u.
Since each xnβ lies in [a,b], the sequence (xnβ) is bounded. By Bolzano-Weierstrass Theorem for Real Sequences, there is a subsequence (xnkββ) and a real number xmaxβ such that xnkβββxmaxβ.
We claim that xmaxββ[a,b]. If xmaxβ<a, then with Ξ΅=(aβxmaxβ)/2>0, the convergence xnkβββxmaxβ implies xnkββ<a for all sufficiently large k, contradicting xnkβββ[a,b]. Similarly, xmaxβ>b is impossible. Hence xmaxββ[a,b].
Because f is continuous at xmaxβ, it follows that f(xnkββ)βf(xmaxβ). On the other hand, from
uβnkβ1β<f(xnkββ)β€u
we see that f(xnkββ)βu. Therefore
f(xmaxβ)=u,
so f attains its maximum on [a,b].
Apply the same argument to the function βf. Since βf is continuous at every point of [a,b], there exists xminββ[a,b] at which βf attains its maximum. Equivalently, f(xminβ)β€f(x) for every xβ[a,b]. Thus f attains both a minimum and a maximum on [a,b].