How to prove $M(x)$ is continuous? $f $ is continuous in $[a, b]$. 
Show that $ M(x) = \sup\{f(y) : y ∈ [a, x]\}$ is continuous in $[a, b]$
I tried yo think in it as a constant function but this seems  not true 
 A: Hint
$M$ is indeed not a constant map. As $f$ is continuous on the compact $[a,x]$ it attains its maximum at a point $x_0 \in [a,x]$. Then separate the cases $x_0=x$ or not.
A: Choose any $\epsilon > 0$.
We know there is a $\delta > 0$ such that for any $u,v \in [a,b]$ with $|u - v| \leq \delta$ then $|f(u) - f(v)| \leq \epsilon.$
Choose any $x,y \in [a,b]$ and with $|x - y| \leq \delta$ we will show $|M(x) - M(y)| \leq \epsilon$. This will show $M()$ is uniformly continuous and we are done. 
If $x = y$ there is nothing to prove, otherwise wlog assume $x < y$.
Note that for any $t \in [x,y]$ we have $|t - x| \leq \delta$, in particular 
$|f(t) - f(x)| \leq \epsilon$. 
This implies $f(t) \leq f(x) + \epsilon \leq M(x) + \epsilon$ for all $t \in [x,y]$. 
Clearly $f(t) \leq  M(x) \leq M(x) + \epsilon$ for all $x \in [a,x]$.
Combining the above two observations we get
$f(t) \leq M(x) + \epsilon$ for all $t \in [a,y]$. 
Taking supremums we have $M(x) \leq M(y) \leq M(x) + \epsilon$, 
i.e., $|M(y) - M(x)| \leq \epsilon$ and we are done.
