Let $f:\mathbb{R} \to \mathbb{R}$ be a differentiable function. Let $a \in \mathbb{R}$ and define the following sets: \begin{align*} M= \{x>a \mid f(t)>f(a), \forall t \in (a,x] \}\\ N=\{x>a \mid f(t)=f(a), \forall t \in (a,x] \}\\ P=\{x>a \mid f(t)<f(a), \forall t \in (a,x] \} \end{align*} Prove that at least one of these sets is not empty.
I tried to prove this by contradiction. If they were all empty, then, for all $n \in \mathbb{N}_{\geq 1}$ there would be some numbers $a_n,b_n,c_n \in (a,a+\frac{1}{n})$ such that $f(a_n) \leq f(a), \: f(b_n) \neq f(a)$ and $f(c_n) \geq f(a)$. But these sequences that are formed seem independent, and I couldn't connect them such that I reach a contradiction.
The fact that at least one of these sets is not empty is pretty obvious on a graph, but I didn't manage to prove it rigorously. I think I'm missing something obvious.
Edit: Thank you for your counterexamples! As mentioned in one of the comments, I added the differentiability of the function.
If you take $f(x)=\begin{cases}x^2\sin(1/x),& x\neq0\\0,& x=0\end{cases}$ and take $a=0$, then for all $x>0$, there are values of $t_1,t_2,t_3\in(0,x]$ such that $f(t_1)>0=f(0)$, such that $f(t_2)=0=f(0)$ and such that $f(t_3)<0=f(0)$, respectively.
Therefore $M,N,P$ are empty.
Observe that $f$ is even differentiable at all points. Therefore, even for differentiable it is not true.
One can even have $f$ smooth. For example, replace the $x^2$ above with $e^{-1/x^2}$ and the function will be smooth, but still have the same oscillatory behavior near $x=0$.