TITLE: If integral is zero and function is continuous and non negative, then what about the function?
QUESTION [20 upvotes]: If $f$ is continuous on $[a,b]$, $f(x)≥0$ on $[a,b]$ and $$\int_{a}^{b} f(x) =0$$

then prove that $f(x)=0$ for all $x \in [a,b]$.
I tried with Riemann's definite integral definition but couldn't proceed

REPLY [30 votes]: Something more easy. If $f$ is continuous in $[a,b]$ then we can define a map $F:[a,b]\to\Bbb R$ such that $F(x)=\int_a^x f(x) dx$ and $F'=f$.
We have $F(x)≥0$ for every $x \in [a,b]$ because $f(x)\geq0$ for every $x \in [a,b]$.
Also $F$ is increasing because $f(x)≥0$ and we have $F(a)=F(b)=0$, thus $F$ is constant and especially $F(x)=0$.
So $f(x)=0$ for every $x \in [a,b]$.