Actually the definition of local extrema varies.

See for example

http://www.mathhelpforum.com/math-he...um-values.html
The definition I was tought:

Let S be the domain of f, for a point c to be considered a local max there must be an open

interval $\displaystyle I$ about c and $\displaystyle f(c)\geq f(x)$ for

all $\displaystyle x\in I\cap S$

The difference is subtle, in your version local extrema can't occur at endpoints, in my version they can.

I don't know which one is the right one, I just wanted to point this out.