If $f \in \mathscr{R}[a,b]$ and $f(x) \geq 0$ almost everywhere on $[a,b]$ then $\int_{a}^{b} f \geq 0$ 
If $f$ is Riemann integrable on $[a,b]$ and $f(x) \geq 0$ almost everywhere on $[a,b]$ then $\int_{a}^{b} f \geq 0$

My idea is to show for any partition $P$ of $[a,b]$ the upper sum $\mathscr{U}(P,f) \geq 0$. 
So let $I_k$ be any component interval of $P$. Then it contains at least one point $x$ s.t. $f(x) \geq 0$.
Then, $\sup_{x \in I_k} f(x) \geq 0$, then 
$\mathscr{U}(P,f) = \sum_{i=1}^{n} \sup_{x \in I_i} f(x) |I_i| \geq 0$
So $\int_{a}^{b} f \geq 0$.
I am not comfortable/satisfied with my argument Then it contains at least one point $x$ s.t. $f(x) \geq 0$.
How can I improve this argument? 
 A: It suffices to prove that, for measure zero set $N\subseteq[0,1]$, then the set $S:=[0,1]-N$ is dense in $[0,1]$.
For suppose that it is not, then some open interval $I$ that containing $x\in[0,1]$ is such that $(I\cap[0,1])\cap S=\emptyset$, then $I\cap[0,1]\subseteq N$, then $N$ is not of measure zero.
A: $f$ is continuous except possibly on a set of measure zero. If $\int f<0,$ then there is a partition $P=\{a,x_1,\cdots, x_{n-2},b\}$ for which $U(f,P)<0$. This means that there is an $x\in [x_i,x_{i+1}]$ for some $1\le i\le n$ such that $f$ is continuous at $x$ and $f(x)<0.$ Now, continuity implies that $f<0$ on some interval $x\in U\subseteq [x_i,x_{i+1}]$, which is a contradiction.
A: If $f\geq 0$ almost everywhere on $[a,b]$, then by definition the set $N = \{x \in [a,b]: f(x)<0\}$ has zero measure. 
What we want to prove is the following clain: If $I \subset [a,b]$ is an interval with more than two elements, then $I\not \subset N$. Indeed, suppose this is not the case. We have $I \subset N$. Let $|I|$ be the length of the interval $I$, which is positive because this interval contains at least two points. Now, since $N$ has zero measure, if we take $\epsilon = |I|/2$, then we can find intervals $I_1,I_2,\ldots$ such that $N \subset \cup_{i=1}^\infty I_i$ and $\sum_{i=1}^\infty |I_i|<\epsilon$. Therefore, $I \subset \cup_{i=1}^\infty I_i$ and we conclude:
$$|I| \leq \sum_{i=1}^\infty |I_i|< \epsilon =|I|/2,$$
which is a contradiction. Therefore, $I \not \subset N$. So, all intervals containing at least two points have elements not in $N$. 
Now let's work with $$\mathscr{U}(P,f) = \sum_{i=1}^{n} \sup_{x \in I_i} f(x) |I_i|.$$
If $I_i$ have one element, then $|I_i|=0$, and if $I_i$ has two elements, then by what we proved above we have $\sup_{x\in I_i}f(x)\geq 0$. In any case,
$$\mathscr{U}(P,f) = \sum_{i=1}^{n} \sup_{x \in I_i} f(x) |I_i|\geq 0.$$
