$f\geq 0$, continuous and $\int_a^b f=0$ implies $f=0$ everywhere on $[a,b]$: part 2 when considering the Riemann integral, I've seen 

$f\geq 0$ continuous and $\int_a^b f=0$ implies $f=0$ everywhere on $[a,b]$

proved by considering the contrapositive here but am curious about proving it directly. Does the following work?

Let $\left( \mathcal{U}{\int}_a^b \right)$ denote the upper Reimann integral and $U(f,P)$ the upper sums of $f$ wrt partition $P$. Since $f$ is integrable with $\int_a^b f(x) \mathrm dx = 0$, we have
  \begin{align*}
    0 = \int_a^b f(x) \mathrm dx = \left( \mathcal{U}{\int}_a^b \right) f(x) \mathrm dx &= \left( \mathcal{U}{\int}_a^b \right) |{f(x)}| \mathrm dx \\
    &\geq  \bigg \lvert \left( \mathcal{U}{\int}_a^b \right) f(x) \mathrm dx \bigg \rvert = \bigg \lvert \inf_{P\in\mathcal{P}} U(f,P) \bigg \rvert \\
    &= \bigg \lvert \inf_{P\in\mathcal{P}} \sum_{i=0}^n \sup_{[x_{i},x_{i+1}]} f \times (x_{i+1}-x_i) \bigg \rvert
\end{align*}
  Now note that in the last expression we can choose $(x_{i+1}-x_i) > 0$ for $x_{i+1}\neq x_i$, so $\sup f \leq 0$, but by assumption we have $f \geq 0$, so we must have $f \equiv 0$ in $[a,b]$.

 A: Your proof is flawed (not merely because you fail to invoke continuity).
First, you do not need the steps involving absolute values.  If $f(x) \geqslant 0$ on $[a,b]$ then for any partition $P$ we have $U(f,P) \geqslant 0$ since $M_j =\sup_{x \in [x_{j-1},x_j]} f \geqslant 0$ on any subinterval $[x_{j-1},x_j]$ and it is implicit for partitions used in defining the Riemann integral that $x_j > x_{j-1}.$
This also implies $\mathcal{U}\int_a^bf(x) \, dx = \inf_{P \in \mathcal{P}}U(f,P) \geqslant 0$, but that is already known since $f$ is integrable with $\int_a^bf(x) \, dx \geqslant 0$.
Simplifying your argument, we have
$$0 = \int_a^b f(x) \, dx = \mathcal{U} \int_a^b f(x) \, dx = \inf_{P \in \mathcal{P}}U(f,P) = \inf_{P \in \mathcal{P}}\sum_{j=1}^n M_j(x_j - x_{j-1})$$
This is all perfectly consistent with the hypothesis $f \geqslant 0$. Without invoking continuity we cannot conclude that $M_j = 0$ for all $j$ and all $P$. That is because the infimum of a set can be $0$ even if every element of the set is strictly positive.
For example, with $x_n = 1/n$ for $n \in \mathbb{N}$ we have $\inf_n x_n = 0$, yet $x_n > 0$ for every $n$.
A: The standard proof of this fact is that if $f>0$ somewhere, then since $f$ is continuous, $f>\epsilon>0$ for some $\epsilon$ small enough and all $x$ in some $[c,d]$ with $c<d$. In particular, any Riemann sum that picks a sample point from the interval $[c,d]$ will be at least $(d-c)\epsilon$.
A: Well, I think that's correct (upper and lower sums belong to the Darboux integral, not Riemann integral, but both are equivalent). It's unnecessarily complicated, though. $F(x)=\int^x_af(x)\,dx$ has to be non-decreasing (since $f\ge 0$), $F(a)=F(b)=0$ implies $F(x)=0$ for all $x\in[a,b]$, so $f(x)=F'(x)=0$.
