$f$ real continuous map in $[a,b]$. $∀ x_0∈[a,b], ∃ (c, d) : x∈ (c, d)⊂ [a,b]$ s.t. $x$ is minimum for $f$ in $(c,d)⇒f$ is constant map If $f(x)$ is continuous at the closed interval $[a,b]$, and $\forall x_0\in [a,b]$, there is an open interval $U$ containing $x_0$  s.t. $f(x_0)$ is none bigger than $f(\eta)$ for any $\eta\in U$, then prove that $f$ is constant on $[a,b]$.
I think that if we can prove for all $x\in[a,b]$, there is an open interval containing $x$ and $f$ is constant on that interval, then we can use Heine-Borel theorem to prove the statement. But how to prove for all $x$ there is an open interval containing $x$ and $f$ is constant on that interval?
 A: Following the idea of @Kelenner: As $f$ is continuous on the compact set $[a,b]$ it will attain its maximum $M$ at a certain point $x_{M} \in [a,b]$.
Due to the assumption about $f$ there is is an open interval U containing $x_{M}$ such that $f(x_M) \leq f(\eta)$ for all $\eta \in U$. But as $f(x_M)$ is tha maximum this means
$$f(x_M) = f(\eta)\qquad \eta \in U$$
This means that $f$ is constant in an open interval and you can try to continue your proof from this point by applying Heine-Borel somehow.
However you can prove the entire statement directly from this reasoning: consider the set $X:=\{x\in[a,b]: f(x) = M\}$ which is nonempty and which is closed (as $f$ is continuous) and as well open.
The latter is due to the fact (which we showed above) that for each point, where the maximum is attained there is also an enclosing open interval where $f$ is constantly  $M$.
So $X$ is a nonempty clopen subset of $[a,b]$, and as $[a,b]$ is connected, it must hold $X= [a,b]$. Thus $f$ must be constant.
