If $f(x)$ is continuous on $[a,b]$ and $M=\max \; |f(x)|$, is $M=\lim \limits_{n\to\infty} \left(\int_a^b|f(x)|^n\,\mathrm dx\right)^{1/n}$?

Let $f(x)$ be a continuous real-valued function on $[a,b]$ and $M=\max\{|f(x)| \; :\; x \in [a,b]\}$. Is it true that: $$ M= \lim_{n\to\infty}\left(\int_a^b|f(x)|^n\,\mathrm dx\right)^{1/n} ? $$

Thanks!


Put $S_{\delta}:=\{x\in\left[a,b\right], |f(x)|\geq M-\delta\}$ for any $\delta>0$. Then we have for all $n$ $$M\cdot (b-a)^{\frac 1n}\geq\left(\int_a^b|f(x)|^ndx\right)^{\frac 1n}\geq \left(\int_{S_{\delta}}|f(x)|^ndx\right)^{\frac 1n}\geq (M-\delta)\left(\lambda(S_{\delta})\right)^{\frac 1n}.$$ Since $f$ is continuous, the measure of $S_{\delta}$ is positive and taking the $\liminf$ and $\limsup$, we can see that $$M\geq \limsup_n \left(\int_a^b|f(x)|^ndx\right)^{\frac 1n}\geq M-\delta\quad \mbox{and }\quad M\geq \liminf_n\left(\int_a^b|f(x)|^ndx\right)^{\frac 1n}\geq M-\delta$$ for all $\delta>0$, so $\lim_{n\to\infty}\left(\int_a^b|f(x)|^ndx\right)^{\frac 1n}=M$.