Boundary points are local extrema? Let $f:[a,b]\rightarrow \mathbb{R}$ be a continuous function.(The continuity at the endpoints are defined with the left and right limits.) 

Then does $f$ has a local maximum or minimum at $a,b$?(Local extrema
  at the endpoints are defined with the intersection of the domain
  $[a,b]$ and an open interval.)

My guess is that since $f$ is continuous at the endpoints, it is impossible to find two points $c,d$ in $[a,b]$ such that $f(c)\leq f(a)\leq f(d)$ for every interval centered at $a$, similarly for $b$.

Let $f(x) = x\sin\left( \frac 1 x \right)$ defined over $(0,1]$ prolongated by $0$ at $x=0$
This function is continuous, yet $x=0$ is not a local extrema, since for every $0<\varepsilon<1$, defining $I_\varepsilon = [0,\varepsilon]$, you can find some $x_p \in I_\varepsilon$ where $f(x_p)>0$ and $x_m \in I_\varepsilon$ such that $f(x_m)<0$.
By taking its symmetric with respect to $x=1$, you can construct a continuous function where neither of the endpoints are local extrema.
