Let $f$ be continuous and Riemann integrable on $[a, b]$ and $f(x) \geq 0$ for all $x \in [a,b]$. I'm trying to show that if $\int^b_a f(x) \ dx = 0$ implies that $f(x) = 0$ for all $x \in [a,b]$.
My answer:
Prove by contradiction.If not,then $\exists x_0\in[a,b]$ such that $f(x_0)> 0$.$f$ is continuous on $[a,b]$,which means $\exists \varepsilon>0$ such that $\forall t\in (x_0-\varepsilon,x_0+\varepsilon)$,$|f(t)-f(x_0)|\leq \frac{f(x_0)}{2}$.So $\forall t\in (x_0-\varepsilon,x_0+\varepsilon)$,$\frac{f(x_0)}{2}\leq f(t)\leq \frac{3f(x_0)}{2}$.Now set a [partition] $P$ of $[a,b]$ such that $x_0-\varepsilon,x_0+\varepsilon\in P$.Then $L(f,P)\geq \varepsilon f(x_0)$(Why?).Because $\int_a^bf(x)dx\geq L(f,P)$(Why?),so $\int_a^bf(x)dx\geq \varepsilon f(x_0)>0$,this contradicts "$\int^b_a f(x) \ dx = 0$".So $\forall x\in [a,b]$,$f(x)=0$.