If
$f$ is continuous on a closed interval
$[a,b]$, then $f$ attains both an absolute
maximum value and an absolute minimum value at
some numbers in $[a,b]$.
This theorem tells us that we don't have to worry about whether
absolute maxima or minima occur, just about where they are. This may seem
obvious, but the theorem does not apply when the function is
discontinuous (what is the maximum value of $1/x$ on $[-1,1]$?) or when
the interval isn't closed (what is the maximum value of $f(x)=1/x$ on $(0,1)$?).