Suppose $f$ is a function of $\mathbb{R}$ and satisfies $$\forall \ x_0 \in \mathbb{R},\ \exists \ \delta > 0,\ f(x_0) \geq f(x),\ \forall x \in (x_0 - \delta, x_0 + \delta).$$
Prove that there exists a nondegenerate interval $I$, $f$ is constant over $I$.
There are no conditions on the continuity of $f$, so I don't know where to start. I tried the principle of nested intervals but failed.
Any kind of help is appreciated and thank you very much in advance!