Does a local max that is not strict imply a function is constant in some interval?

414 Views Asked by At

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.

1

There are 1 best solutions below

2
On BEST ANSWER

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} $$