If $f$ is continous and has local maxium at c then there exists local $(c-\delta,c+\delta)$ such that $f$ is increasing on $(c-\delta,c)$ Given that $f$ is continous on $\mathbb{R}$ and has a local maximum at $c$, I make an observe that there should exists a local $(c-\delta,c+\delta)$ such that $f$ is increasing on $(c-\delta,c)$ and decreasing on $(c,c+\delta)$.
I’ve tried to use supremum and infimum to solve it but got no result. Is there anyway to solve it or my hypothesis just wrong?
Thank you.
 A: Let
$$f(x) = \begin{cases}-x^2 - x^2 \sin(1/x) & \text{if } x \neq 0 \\ 0 & \text{if } x = 0.\end{cases}$$
We see that $f$ is continuous for $x \neq 0$, and at $x = 0$, then squeeze theorem tells us that
$$0 \le |x^2\sin(1/x)| \le x^2 \to 0,$$
hence $x^2\sin(1/x) \to 0$, and so $f(x) \to 0 = f(0)$ as $x \to 0$.
Also note that, for $x \neq 0$,
$$f(x) = -x^2(1 + \sin(1/x)) \le 0 = f(0),$$
as $-x^2 \le 0$ and $1 + \sin(1/x) \ge 0$. Thus, $x = 0$ is a (global) maximum.
Note that $f$ is differentiable for $x \neq 0$ (actually, it's differentiable everywhere, but we don't need that). We can tell whether $f$ is increasing or decreasing judging by the sign of $f'(x)$. We have, for $x \neq 0$,
$$f'(x) = -2x - 2x\sin(1/x) + \cos(1/x).$$
Note that, for $0 < |x| < 1/8$, we have
$$|-2x - 2x\sin(1/x)| = 2|x| \cdot |1 - \sin(1/x)| \le 4|x| \le \frac{1}{2}.$$
Also note that $\cos(1/x)$ achieves $1$ and $-1$ in sequences approaching $0$, and indeed can be chosen to approach $0$ from the left or the right. Eventually these sequences must lie inside $(0, 1/8)$ or $(-1/8, 0)$. If we choose such a point where $\cos(1/x) = 1$ where $0 < |x| < 1/8$, then we get
$$f'(x) = -2x - 2x\sin(1/x) + \cos(1/x) \ge -\frac{1}{2} + 1 = \frac{1}{2} > 0.$$
Similarly, if we choose $x$ such that $\cos(1/x) = -1$ and $0 < |x| < 1/8$, then
$$f'(x) \le \frac{1}{2} - 1 < 0.$$
But, these conditions happen on sequences converging to $0$, both from the left and from the right, so $f'$ fails to maintain positivity or negativity on an interval $(0, \delta)$ or $(-\delta, 0)$. Thus, on such intervals, $f$ is neither increasing or decreasing.
