Here's the statement:
If $x' = f(x)$, an autonomous scalar dynamical system for $x\in\mathbb{R}$, where $f$ is continuously differentiable, then all solutions are either strictly monotone or constant.
If we have $f(x)=cosx$ then $f$ is still $C^1$, it is continuously differentiable, and the solution would be $x(t) = sin(x)+K$ for $K\in\mathbb{R}$. Here, x(t) is not constant and it is not strictly monotone.
So, how does the statement hold? Isn't my example a counter-example to it? Why and how is the statement true?
Edit: I understand why my counter-example doesn't work. How can I go about proving the statement?
Here's a proof that illustrates a common technique for these kinds of arguments.
Suppose $x(t)$ is a solution to $x'=f(x)$.
Let's assume that $x'$ changes sign from negative to positive at $t=c$.
Then $x'$ would be increasing at $t=c$ which would mean $x''(c)>0$
However, with implicit differentiation, it follows that
$$x''(c)=f'(x(c))x'(c)=0$$ which is a contradiction. You can proceed with an identical argument for the case that $x'$ changes sign from positive to negative at $t=c$