TITLE: Is the Riemann integral of a strictly smaller function strictly smaller?
QUESTION [5 upvotes]: We all know that if $f\leq{}g$ in $[a,b]$ then
$$
\int_a^bf\,dx\leq\int_a^bg\,dx
$$
now, imagine that we have $f<g$, is it true that
$$
\int_a^bf\,dx<\int_a^bg\,dx
$$

REPLY [5 votes]: Here is an argument which borrowed ideas from measure theory, but does not assume any direct knowledge on it.

Proof. It suffices to prove the following claim:

Claim. If $h \in \mathscr{R}([a, b])$ satisfies $h \geq 0$ and $\int_{a}^{b} h \, \mathrm{d}x = 0$, then $h(c) = 0$ for some $c \in [a, b]$.

Step 1. To this end, assume that $h$ satisfies the assumptions of the claim. Then we have the following observation:

Observation. For any $\epsilon > 0$ and $\delta > 0$, there exists a relatively open subset $U \subseteq [a, b]$ such that

$U$ is the union of finitely many relatively open subintervals of $[a, b]$,
the lengths of $U$ is less than $\delta$, and
$\{ x \in [a, b] : h(x) > \epsilon \} \subseteq U$.


We first check that this indeed implies the claim. For each $n \geq 1$, choose $U_n$ as in Observation with $\epsilon = 1/n$ and $\delta = 3^{-n}(b-a)$, so that

the length of $U_n$ is less than $3^{-n}(b-a)$, and
$\{ x \in [a, b] : h(x) > 1/n \} \subseteq U_n$.

Then we find that
$$ \{ x \in [a, b] : h(x) > 0 \}
= \bigcup_{n=1}^{\infty} \{ x \in [a, b] : h(x) > 1/n \}
\subseteq \bigcup_{n=1}^{\infty} U_n. $$
Now assume otherwise that $h > 0 $ on all of $[a, b]$. Then it follows that $\bigcap_{n=1}^{\infty} U_n = [a, b]$ and thus $\{ U_n : n \geq 1 \}$ is an open cover of $[a, b]$. So we can pick a finite subcover, say $\{ U_{n_1}, \dots, U_{n_K} \}$. This implies that
$$ [a, b] = U_{n_1} \cup \cdots \cup U_{n_K}. $$
This is a contradiction since the right-hand side has length at most 
$$\sum_{n=1}^{\infty} 3^{-n}(b-a) < b-a. $$
Step 2. It now remains to prove the observation. (The proof is essentially a variant of the Markov's inequality.)
Choose a partition $P$ such that $U(P, h) < \delta \epsilon$. Write $P = \{a = x_0 < \cdots < x_N = b\}$ an define $M_j = \sup_{[x_{j-1}, x_j]} h$ and $\Delta x_j = x_j - x_{j-1}$. Then we know that $U(P, h) = \sum_{j=1}^{N} M_j \Delta x_j < \delta \epsilon$. On the other hand, let $J$ be the set of indices $j$ for which $M_j > \epsilon$. Then
$$ \sum_{j \in J} \Delta x_j 
\leq \frac{1}{\epsilon} \sum_{j \in J} M_j \Delta x_j
\leq \frac{1}{\epsilon} U(P, h)
< \delta $$
and that $\cup_{j \notin J} [x_{j-1}, x_j]$ is a finite union of closed intervals on which $h \leq \max_{j \notin J} M_j \leq \epsilon$ holds. Therefore the observation follows by taking $U$ as the complement of $\cup_{j \notin J} [x_{j-1}, x_j]$.