I am working on the following problem:
Let $f:\mathbb{R}\to\mathbb{R}$ satisfies that for all $x_0\in\mathbb{R}$, there exists some $\delta>0$ such that $f(x)\le f(x_0)$ for all $x\in (x_0-\delta, x_0+\delta)$. Does there exists some subinterval $I$ of $\mathbb{R}$ such that $f$ is a constant on $I$?
The problem can be done when $f$ is assumed to be continuous, in which case $f$ is a constant. I have known that $f$ need not to be a constant in my case, for instance, consider $f(x)=\chi_{(0,1)}+2\chi_{(-\infty,0]\cup[0,+\infty)}$, but I'm not sure whether such $I$ always exists.
EDIT: Seems that this answer offers a proof involving Baire's Theorem, however I didn't see how Baire's Theorem works in this case.As I know Baire's theorem works only when $F_n$ are closed. If we take the closure more elements are added to $F_n$ and the proof seems to fail to me. Can someone kindly elaborate this to me? Thanks in advance.