Is $f$ constant when each point is local minimum or maximum? 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$?

The paper you link gives a counterexample already. Consider $X = [0,1]^2$ ordered lexicographically, i.e. $(x,y) < (x',y') \iff (x < x' \text{ or } (x = x' \text{ and y < y'}))$, and give $X$ the order topology. This is a connected space. Then the projection $p:(x,y) \mapsto x$ is a continuous function, and every point of $X$ is a local extremum. But $p$ is not constant.
