The candidates test

On a closed interval the absolute maximum and minimum are among the critical points and the endpoints, so evaluating $f$ at each candidate finds them.

From AP Calculus AB.