A real-valued continuous function on a nonempty compact space attains both its minimum and its maximum.
Let be continuous on , bounded above, and suppose its limit superior at from the right is at most . If some has , then attains its maximum on . A sufficiently short initial interval has all values below . On the remaining closed interval, the extreme value theorem supplies a maximum, which is consequently global. This can prove attainment despite an oscillatory discontinuity at one endpoint.
The extreme value theorem requires continuity on the entire closed interval. A bounded function can have values tending to an endpoint envelope without ever reaching that envelope, while its defined endpoint value is smaller. To prove nonattainment, establish a strict pointwise upper bound and construct a sequence approaching that bound. An oscillatory factor can supply the approaching sequence by selecting phases where it equals .