I have the following question. Thanks for any help in advance. Any hints would be appreciated.
Suppose $f: \mathbb{R} \rightarrow \mathbb{R}$ has a local max at x that is not a strict local maximum. Is it necessarily true that f is constant in some non-empty open interval (a,b)?
My first thought was to find a counterexample. I wanted to use the Dirichlet function as a counterexample, but that would not work here. It should be noted that the function is not necessarily differentiable.
You can construct also a differentiable function with these properties: $$ f(x) := \begin{cases} x^2 ( 1 - \sin\frac{1}{x}), & \text{if}\ x\neq 0,\\ 0, & \text{if}\ x = 0. \end{cases} $$