Let a function f be continuous. Assume $\int_a^b f=0$ Prove $f(x)=0$ for all $x\in [a, b]$ Let $f:[a, b]\to \mathbb{R}$ be continuous. Assume $f(x)\geq 0$ for all $x\in[a, b]$, and that $$\int_a^b f\text{ }\mathrm{ d}x=0$$ Prove that $f(x)=0$ for all $x\in[a, b]$.
Would you recommend using a direct proof or a proof by contradiction by assuming there exists $y\in[a, b]$ such that $f(y)\geq 0$?
 A: Sketch of proof:
Assume the opposite, so $f(x)>0$ for some $x$. use continuity to prove $f$ is larger than a positive $l$ in a closed interval $[c,d]$ around $x$.
Use $\int_a^b\geq L\{a,c,d,b\}\geq (d-c)l>0$ to conclude if $f$ is strictly positive in a point the integral is greater than zero.
Therefore if $\int_a^bf=0$ we have $f$ is never strictly positive.
A: Suppose that $f(c) > 0$, for some $c \in [a,b]$. Let $m = \frac{f(c)}{2}$ then  there exists $\delta > 0$ such that $f(x) > m$, for all $x \in [c- \delta, c+ \delta]$ then considering $P$ a partition of $[a,b]$ we have $$L(f; P) > 2m \delta \implies \int_a^b f(x)dx \geq L(f;P) > 2m\delta > 0$$
A: Let $F'(x) = f(x)$. Then $F(b) - F(a) = 0$. The differential is defined in $b$ and $a$, and thus $(F(b) - F(a))' = 0'$, so $f(b) = f(a)$. 
Since the function $f$ is continuous, there is $c$ between $[a,b]$ such that $f(c) = f(a)$. We also have $F(b) - F(a) = F(b) - F(c) + F(c) - F(a)$, and as $f(x) \ge 0$, $F(c) = F(a)$ (because the integral is crescent) for every $c$ between $a and b$, so $f(c) = f(b) = f(a)= k$ for every $c$ in the interval and the integral reduces itself to $k(b-a)=0$, so $f(c)=k=0$.
