I encountered the following problem:
Find all $f:\mathbb{R}\rightarrow\mathbb{R}$ such that $f^2$ is differentiable on $\mathbb{R}$ and $$(f^2)'=f$$
I am not interested in this problem's solution, I have a different question. I denoted by $g=f^2$, $g:\mathbb{R}\rightarrow [0, +\infty)$. It is clear that $g$ is continuous, differentiable and $$(g')^2=g$$ If $g$ would have a strict local maximum, let it be $x_0$, then $g'(x_0)=0$, so $g(x_0)=0$ and since $g$ is continuous and $g:\mathbb{R}\rightarrow [0, +\infty)$ we have that $g$ has no strict local maximum.
My question is the following:
If a continuous function $f$ has no strict local maximum or $f$ has no strict local minimum, then is $f$ monotone or constant?
(in my problem we have that $g$ is also differentiable but I am curious if this holds for any continuous function)
I thought immediately at the Weierstrass Function, which is everywhere continuous, nowhere differentiable and we also know that it is not monotone on any interval. If it has no local maximum, then what I'm saying is wrong, but I could't found if Weierstrass Function has or hasn't any local maximum/minimum.
EDIT:
@user539887 and @RobertZ showed that my question doesn't hold for strict extreme point, but what if we think at local extreme points? Not strict? The question will be therefor
If a continuous function $f$ has no local maximum or $f$ has no local minimum, then is $f$ monotone or constant?