Endpoints are candidates for global extrema but not local extrema

The definition of a local max is: f(c) is a local max if there is an open interval containing c such that f(c) > f(x) for all x in that open interval.

Same for a local min

There is no open interval containing an endpoint