Continuous function and integral Suppose $f$ is continuous on $[a,b]$ with $\int^{b}_{a} f = 0$ and $f(x)\geq 0$ for all $x\in [a,b]$ then $f(x)=0$ $\forall x\in[a,b]$.
Proof: Suppose there exists $c\in [a,b]$ such that $\frac{f(c)}{2}>0$. By continuity, for $\epsilon =\frac{f(c)}{2}$, there exists $\delta>0$ such that if $x\in [a,b] \cap (c-\delta, c+\delta)$  then $f(x)>\frac{f(c)}{2}$. 
So choose $\delta^1>0$ to be so that $(c-\delta^1,c+\delta^1)\subseteq [a,b]$ and $(c-\delta^1,c+\delta^1)$ $\subseteq$ $(c-\delta, c+\delta)$ then
$\int^{b}_{a}f \geq f(c)\delta^1>0$. So we have a contradiction.
The existence of $\delta^1$ is intuitively and geometrically clear. How do I formally prove its existence though?
 A: Suppose there exists $c\in[a,b]$ with $f(c)>0$. If $c=a$ then choose $\delta>0$ such that $c\in[a,a+\delta)\subset[a,b]$. If $c=b$ then choose $\delta>0$ such that $c\in(b-\delta,b]\subset[a,b]$. If $a<x<b$ then choose $\delta>0$ such that $(\delta-c,\delta+c)\subset[a,b]$. In any case, choose $\delta$ so that $f(x)>0$ on the relevant interval. Now let $\delta'=\frac\delta2$ and consider the relevant closed interval ($[a,a+\delta']$, $[b-\delta',b]$, or $[c-\delta',c+\delta']$ as according to $c=a$, $c=b$, or $a<c<b$). Since $f$ is continuous, it attains a minimum value on a closed interval; call it $\varepsilon$. Let $I$ be the relevant interval. Then $f(x)\geqslant \varepsilon$ for all $x\in I$. It follows that
$$
\int_a^b f(x)\ \mathsf dx \geqslant \int_I f(x)\ \mathsf dx \geqslant \int_I\varepsilon\ \mathsf dx >0,
$$
as $I$ has strictly positive Lebesgue measure. This of course contradicts the assumption that $\int_a^b f(x)\ \mathsf dx = 0$.
A: If $f$ is not identically zero, then there exists $c \in [a,b]$ such that $f(c) >0$. Now, from the continuity of $f$, if $\epsilon >0$ is given, there exists some $\delta>0$ such that: $$|x-x_{0}|<\delta \Rightarrow |f(x)-f(x_{0})|< \epsilon$$
Thus, take $\epsilon <f(x_{0})$ and we have:
$$\int_{x_{0}-\delta}^{x_{0}+\delta}f(x)dx \le \int_{x_{0}-\delta}^{x_{0}+\delta}(f(x_{0})-\epsilon)dx = (f(x_{0})-\epsilon)2\delta > 0$$
