# Is the maximum function of a continuous function continuous?

Suppose $f(x)$ is continuous on the closed interval $[a,b]$. Define $m(x)=\max_{a\leq s\leq x}\, f(s)$, $a\leq x\leq b$. Is $m(x)$ continuous necessarily? Thank you.

-
Yes it is. What are your thoughts? –  Did Oct 14 '12 at 16:02
Thank you. I know that $m(x)$ is increasing. So it is continuous unless it has jumps around some points. And this is not very possible since $f(x)$ is continuous. But I just do not know how to show this rigorously. Do you have any suggestion? –  Knightgu Oct 14 '12 at 16:07

Yes it is.

HINT: Clearly $m(s)$ is monotonically non-decreasing on $[a,b]$. Thus, if it is discontinuous at some $x\in[a,b]$, it must have a jump discontinuity at $x$: either $\lim\limits_{s\to x^-}m(s)<m(x)$, or $m(x)<\lim\limits_{s\to x^+}m(s)$.

1. Suppose first that $\lim\limits_{s\to x^-}m(s)<m(x)$ for some $x\in(a,b]$. Show that $\lim\limits_{s\to x^-}f(s)<f(x)$, contradicting the continuity of $f$.

2. Then suppose that $m(x)<\lim\limits_{s\to x^+}m(s)$ for some $x\in[a,b)$. Show that $f(x)<\lim\limits_{s\to x^+}f(s)$, again contradicting the continuity of $f$.

Added: Here’s a little more help with (1). Let $u=\lim\limits_{s\to x^-}m(s)$. For all $s\in[a,x)$ we have $$f(s)\le m(s)\le u<m(x)=\max\{f(s):a\le s\le x\}\;.$$ In other words, $f(s)\le u$ for every $s\in[a,x)$, but $\max\{f(s):a\le s\le x\}=m(x)>u$; this is possible only if $f(x)=m(x)$. But then $\lim\limits_{s\to x^-}f(s)\le u<f(x)$.

(2) can be dealt with very similarly.

-
Thank you. That is a quite rigorous proof. It helps a lot. –  Knightgu Oct 14 '12 at 18:25
@Knightgu: You’re welcome; glad it helps. –  Brian M. Scott Oct 14 '12 at 21:52
$f$ is uniformly continuous on $[a,b]$. Fix $\varepsilon>0$, choose $\delta$ such that $|f(x)-f(y)|\leq\varepsilon$ when $|x-y|\leq \delta$ and let $x\in [a,b]$. We have to show that $|m(x)-m(x+t)|\leq\varepsilon$ if $|t|\leq \delta$. We have for $t>0$ that $$m(x+t)=\max_{0\leq s\leq x+t}f(s)=\max\{f(x),\max_{x\leq s\leq x+t}f(s)\},$$ and for $t<0$ that $$m(x+t)=\max\{f(x-t),\max_{x-t\leq s\leq x}f(s)\}.$$ We have $|f(x)-\max_{x\leq s\leq x+t}f(s)\}|\leq\varepsilon$ when $0<t<\delta$ and $|f(x-t)-\max_{x-t\leq s\leq x}f(s)|<\varepsilon$ when $0>t>-\delta$.
I wonder if it is the case in your answer that $$m(x+t)=max\{m(x),\,max_{x\leq s\leq x+t}\,f(s)\}$$for t>0. Noting that $f(x)\leq m(x),$ we therefore have $$|m(x+t)-m(x)|\leq max\{0,\,|max_{x\leq t\leq x+t}\,f(s)-f(x)|\}.$$ The case $t<0$ is similar. –  Knightgu Oct 14 '12 at 17:27