Let $f:[a,b]\to\Bbb{R}$ be continuous. Does $\max\{|f(x)|:a\leq x\leq b\}$ exist? Let $f:[a,b]\to\Bbb{R}$ be continuous. Does \begin{align}\max\{|f(x)|:a\leq x\leq b\} \end{align} exist?
MY WORK
I believe it does and I want to prove it.
Since $f:[a,b]\to\Bbb{R}$ is continuous, then $f$ is uniformly continuous. Let $\epsilon> 0$ be given, then $\exists\, \delta>$ such that $\forall x,y\in [a,b]$ with $|x-y|<\delta,$ it implies $|f(x)-f(y)|<\epsilon.$
Then, for $a\leq x\leq b,$
\begin{align} f(x)=f(b)+[f(x)-f(b)]\end{align}
\begin{align} |f(x)|\leq |f(b)|+|f(x)-f(b)|\end{align}
\begin{align} \max\limits_{a\leq x\leq b}|f(x)|\leq |f(b)|+\max\limits_{a\leq x\leq b}|f(x)-f(b)|\end{align}
I am stuck at this point. Please, can anyone show me how to continue from here?
 A: Here's what I would do, in a proof sketch.
Claim: If $f:[a,b] \rightarrow \mathbb{R}$ is continuous, then $f([a,b])$ has a maximal element.
Proof Sketch: Since the set $[a,b] \subset \mathbb{R}$ is closed and bounded, by the Heine-Borel (or Bolzano-Weierstrass) Theorem it is compact. Since $f:[a,b] \rightarrow \mathbb{R}$ is continuous, it preserves compactness, so $f([a,b]) \subset \mathbb{R}$ is also compact. But since $f([a,b]) \subseteq \mathbb{R}$ is compact, again by Heine-Borel it is closed and bounded. Thus, we can construct a sequence of points converging to the supremum of $f([a,b])$, and since $f([a,b])$ is a closed set it must also contain the limit, which is precisely the maximal element of $f([a,b])$ we wanted.
If you have any questions about any of the arguments used in the Proof Sketch, do not hesitate to ask. 
Regards!
-Dan
A: you can prove in an another way  

as $f:[a,,b] \to \Bbb R$ so $f([a,b])=[m,M]$ if $f(x) \ge 0$ then its obvious that $\begin{align}\max\{|f(x)|:a\leq x\leq b\} \end{align}$ exists. similarly if $f(x) \le 0$ then  $f([a,b])=[-m,-M]$ where $m,M \ge 0$ then again $\begin{align}\max\{|f(x)|:a\leq x\leq b\} \end{align}$ exists and $\begin{align}\max\{|f(x)|:a\leq x\leq b\} \end{align}=m$.
  in similar manner u can prove for when  $f([a,b])=[-m,M]$ where $m,M \ge 0$

A: Because $[a,b]$ is compact, every sequence in $[a,b]$ has a subsequence that limits to a point in $[a,b]$. Pick a sequence $x_n \in [a,b]$ such that $\lim_{n \rightarrow \infty} |f(x_n)| = \sup_{[a,b]}|f|$. Now get a convergent subsequence $x_{n_k}$ that converges to some $x \in [a,b]$. 
By continuity of $|f|$, 
$|f(x)| = |f( \lim_{k\rightarrow \infty}x_{n_k})| =  \lim_{k\rightarrow \infty} |f(x_{n_k})| = \lim_{n \rightarrow \infty} |f(x_n)| = \sup_{[a,b]}|f|$.
