See Compactness Is Preserved By Continuity which this corollary comes from.
If is continuous on a closed interval then attains an absolute maximum and an absolute minimum in that interval.
Proof
Let . Take to be continuous. By the Heine-Borel Theorem (Compact Equivalences) then our is compact. Therefore, by Compactness Is Preserved By Continuity then is compact. Compact gives that must be bounded, so then we can define and both exist.
are both closed (by being compact), so then our . So then where and as desired (since these points ) are our minimum/maximum points.
☐