Mistake in proof of: $f$ continuous in $[0,1]$ and such that $f(0)=0, \int_0^1 f(x)dx=1$ implies maximum of $f$ greater than $1$

Addendum to the existing answers: If you know the following result

Lemma: Let $g$ be a continuous non-negative function on $[a,b]$. Then $$ \int_a^bg(x)\,dx=0\quad\Rightarrow\quad g=0\text{ on }[a,b]. $$

then you may also start as follows:

Assume that $f\le 1$ on $[0,1]$. Then $g=1-f\ge 0$ and $$ \int_0^1 g(x)\,dx=0. $$ By the lemma above, it implies $g=0$, i.e. $f=1$, on $[0,1]$ (contradiction with $f(0)=0$).


Proof of the lemma: set $$ G(x)=\int_a^x g(t)\,dt. $$ Then $$ 0=G(a)\le G(x)\le G(b)=0\quad\Rightarrow\quad G=0\text{ on }[a,b]. $$ Hence, $G'=g=0$.


There is no mistake, but the proof is not finished.

You only proved that $M\geq 1$. You have to prove that $M>1$.

In fact, without the assumption that $f(0)=0$, you could very well have $M=1$, since the constant function $f$ for which $\forall x\in[0,1]: f(x)=1$ is a possibility.


However, if $f(0)=0$, then $M=1$ is impossible, but you still have to show that.

To do that, I would advise you to split the interval into two parts, $[0,1]=[0,\delta]\cup[\delta,1]$.

Then, if you pick a small enough $\delta$, you can be sure that $f$ is "small" on the entire interval, meaning the integral $\int_0^\delta f(x)dx$ will also be small. In turn, this forces the integral $\int_\delta^1 f(x)dx$ to be such that $f$ must be larger than $1$ at some point.