TITLE: $f\geq 0$, continuous and $\int_a^b f=0$ implies $f=0$ everywhere on $[a,b]$
QUESTION [17 upvotes]: This is problem 6.2 from the 3rd edition of Principles of Mathematical Analysis. 

Problem 6.2: Suppose $f\geq 0$, f is continuous on $[a, b]$, and $\int_a^b f(x) \, dx = 0$. Prove that $f(x)=0$ for all $x \in [a, b]$.

I'm looking for a critique of my proof. It's a pretty easy problem, but I am always wary of making too bold of assumptions, especially on these low level/fundamental proofs. I'll be using Rudin's notation and refer to theorems from the text (If I should include the text of each theorem, feel free to leave a comment... I'm lazy but could probably use the TeX practice :p)
Proof: Assume, for contradiction, that $f>0$. Then, for any partition $P$ we have the Lower Riemann Sum: $L(P, f)=\sum_{i=1}^n m_i \, \Delta x_i$. At least one $\Delta x_i$ must be positive, since $a < b$, and each $m_i$ must be positive since we have $f>0$ by assumption, so certainly $\sup f > 0$. That means $L(P, f)>0$. Thus, we have:
$$0 = 0(b-a) < L(P,f)\leq \sup L(P, f) = \inf U(P,f) =L$$
where the last string of equalities holds because our function is continuous on a compact interval, so is integrable by theorems 6.8 and 6.6. So our integral has value $L>0$. This is in contradiction to our given assumption that $\int_a^b f(x) \, dx = 0$, so we must have that $f=0$ on $[a, b]$. $\Box$
So, I am wondering if my proof is correct (and is presented well). Also if someone could enlighten me as to what Rudin means when he say "Compare this with exercise 1," I'd be appreciative. Is it a hint or is there something else he expects you to notice? there are a lot of things I could compare :)...
Exercise 6.1: Suppose $\alpha$ increases on $[a, b]$, $a \leq x_0 \leq b$, $\alpha$ is continuous at $x_0$, $f(x_0)=1$, and $f(x)=0$ if $x\neq x_0$. Prove that $f$ is Riemann-Stieltjes Integrable and that $\int f \, d\alpha = 0$

REPLY [8 votes]: You're plenty of advices for how to prove that by contradiction, but some others mistakes must be pointed out. For example, $\Delta x_i=x_i-x_{i-1}\gt 0$ for $i\in\{1,\ldots,n\}$ and $m_i=\inf_{x\in[x_{i-1},x_i]}f(x)$ so, you must argue: since $f\gt 0$ certainly $\inf f\gt 0$...
However, it's possible to prove this directly. You can argue as follows.
Since $f\geq 0$ everywhere in $[a,b]$, the function $F:[a,b]\to\mathbb{R}$, given by $$F(x):=\int_a^x f(t)\, dt,$$
is increasing. Then you have $$0=F(a)\leq F(x)\leq F(b)=0.$$
Therefore $F$ is the constant function $0$. Now, since $f$ is continuous in $[a,b]$ by the fundamental theorem of calculus,  we have $$f(x)=F'(x)=0.$$