Let $X$ be a connected topological space and $f:X\to \mathbb R$ be continuous. Further, we know that all $x\in X$ are local extrema. Does that imply that $f$ is constant?
I think in case $X$ is second-countable that should be the case because of the proof of Theorem 2 here (it is only stated for separable metric spaces there but I think the same proof works for second-countable spaces). But what about an arbitrary connected topological space $X$?