If $\int_a^bf(x) dx=0$, prove that $f(x)=0$. (Proof verification.) 
Rudin Exercise 6.2 Suppose $f(x)\geq0, f$ is continuous on $[a,b]$ and $\int_a^bf(x) dx=0$. Prove that $f(x)=0$ for all $x\in [a,b]$.

My attempt:
Let $\int_a^bf(x) dx=0$, then $\overline{\int}_a^bf(x) dx=\underline{\int}_a^bf(x) dx=0$, or in other terms:
$$\inf(U(P,f,x))=\sup(L(P,f,x))=0$$
Thus, for any partition $P$, $U(P,f,x)\geq 0$ and $L(P,f,x)\leq0$. Since $f(x)\geq0$ for all $x$, it is apparent that $L(P,f,x)=0$. Note that $U(P,f,x)\geq 0$ is equivalent to $$\sum_{i=1}^n \sup(f(x))\Delta x_i\geq 0,\qquad(x_{i-1}\leq x\leq x_i).$$
Suppose that $f(x)>0$ for some $x\in [a,b]$. Then by continuity, there exists some segment $[x_{i-1},x_i]$ such that for any $x_{i-1}\leq c< d\leq x_i$, $x\in[c,d]$ implies $f(x)>0$.
there exists some $\epsilon>0$ for which $U(P,f,x)-L(P,f,x)\geq \epsilon$, which contradicts the integrability of $f$.
Therefore $f(x)\leq 0$, and $f(x)=0$ for all $x\in [a,b]$
Now, I spoke with one of my TA's about this proof (though an earlier rendition of it) and he told me that there was an error in the selection of my partitions, making the proof invalid. I'd like to hear some of your responses and go a little more in depth as to why it's wrong (if it still is).
 A: How about this approach instead, much more elegant if you ask me. Suppose for the moment that $f$ was not identically zero. This means there exists some $x_0\in[a,b]$ where $f(x_o)>0$. Since $f$ is continuous, then there is a $\delta$-neighborhood where
$$\int_\delta f(x)\,dx>0\implies\int_a^bf(x)\,dx>0$$
since $f\geq0$ outside of the $\delta$ interval. This is a contradiction to $\int f=0$. Therefore $f(x)=0$ $\forall\;x\in[a,b]$.
A: You are right that $L(P,f,x)=0$ for every partition, but you're wrong in concluding a contradiction: the fact that $U(P,f,x)>L(P,f,x)$ is not a contradiction; to the contrary, it is generally true.

Assuming $f$ is not constantly $0$, find a partition where the lower sum is positive. 
Take a point $t$ where $f(t)>0$, and an interval $[x_1,x_2]$ containing $t$ such that $f(x)\ge f(t)/2$ for every $x\in[x_1,x_2]$. Now for the partition $P=\{x_0=a,x_1,x_2,x_3=b\}$ the lower sum is larger than $(x_2-x_1)f(t)/2>0$.
A: Equivalently, prove that if $f$ is is continuous and non-negative, and not constantly $0$ on $[0,1]$ then $\int_0^1f(x)dx>0.$
Suppose $x_0\in [0,1]$ with $f(x_0)>0.$ The continuty of $f$ implies we may take some  $d>0$ such that $f(x)\geq \frac {1}{2}f(x_0)$ for all $x\in [-d+x_0,d+x_0]\cap [0,1].$
Let $J=[-d+x_0,d+x_0] \cap [0,1]=[a,b].$ We have $b-a>0.$ 
If $P$ is a partition of $[0,1],$ there is a finer partition $P'=(x_1,...,x_n),$ where  some $i_0,j_0$ (with $1\leq i_0<j_0\leq n$) satisfy  $x_{i_0}\in [a, \frac {2a+b}{3}]$  and $x_{j_0}\in [\frac {a+2b}{3},b].$ 
We have $(x_{j_0}-x_{i_0})\geq \frac {1}{3}(b-a).$
Let $y_i\in [x_i,x_{i+1}]$ for $1\leq i\leq n-1.$
We have $f(y_i)\geq \frac {1}{2}f(x_0)$ whenever $i_0\leq i\leq j_0-1.$ Therefore $$\sum_{i=1}^{n-1}f(y_i)(x_{i+1}-x_i)\geq \sum_{i=i_0}^{j_0-1}f(y_i)(x_{i+1}-x_i)\geq$$ $$\geq \sum_{i=i_0}^{j_0-1}\frac {1}{2}f(x_0)(x_{i+1}-x_i)=\frac {1}{2}f(x_0)(x_{j_0}-x_{i_0})\geq  \frac {1}{2}f(x_0)\cdot \frac{1}{3}(b-a).$$
Therefore $\int_0^1f(x)dx\geq \frac {1}{2}f(x_0)\cdot \frac {1}{3}(b-a)>0.$
Remarks:(1). The choice of $d>0$ such that $x\in [-d+x_0,d+x_0]\cap [0,1]\implies f(x)\geq f(x_0)$ is just to obtain an interval $[a,b]\subset [0,1]$ with $a<b,$ such that $\{f(x):x\in [a,b]\}$ has a positive lower bound...(2).  Taking $x_{i_0}\in [a,(2a+b)/3]$ and $x_{j_0}\in [(a+2b)/3,b]$ was just to ensure a positive lower bound $\frac {1}{3}(b-a)$ for $x_{j_0}-x_{i_0}$ that does not depend  on $P'$. 
