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$ I'm probably doing something wrong because I am not using one of the hypotheses, but I can't see the mistake.
Problem: let $f:[0,1]\to\mathbb{R}$ be a continuous function such that
$$f(0)=0, \\ \int_0^1 f(x)dx=1$$
Show that the maximum of $f$ is greater that $1$.
I've tried this argument: since $f$ is continuous and $[0,1]$ is compact, by the extreme value theorem there exists $m\in\mathbb{R}$ and $M\in\mathbb{R}$ such that $m\le f(x)\le M$ for any $x  \in [0,1]$.
Integrating in the interval $[0,1]$, it is then
$$\int_0^1 m dx \le \int_0^1 f(x) dx \le \int_0^1 Mdx\implies M \ge \int_0^1f(x)dx$$
But by hypothesis, it is $\int_0^1f(x)dx=1$; hence $M \ge 1$, that is the maximum of $f$ in $[0,1]$ is greater than $1$. However, I'm not using the fact that $f(0)=0$. Where is my mistake?
 A: 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$.
A: 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.
A: There isn't any mistake. If you want $M>1$, instead of $M\ge 1$, you have to use the hypothesis $f(0)=0$ that, in addition with continuity, implies in a neighbourhood of $0$ the function is strictly lower than $1$.
