Integral inequality of measurable functions for every measurable set implies function inequality a.e. as long as measure is $\sigma$-finite

Let $$(X, \mathscr{A}, \mu)$$ be a measure space and let $$f,g: E \to [0, \infty]$$ be measurable functions such that: $$\int_A f d\mu \leq \int_A g d\mu$$ for every measurable $$A \subseteq E$$. If $$E$$ has $$\sigma$$-finite $$\mu$$-measure, then $$f \leq g$$ $$\mu-$$a.e. in $$E$$.

I am not sure how to go about showing this. I have seen, in the case of the Lebesgue measure, that two functions being equal almost everywhere implies that their integrals are equal. However, this proposition is going the other direction and is extended to general measure spaces.

I am also confused about the need for a $$\sigma$$-finite $$\mu$$-measure. Presumably, the need for this comes up somewhere in the proof of the statement, but as I am not sure how to begin, it is not clear to me why this is necessary.

I would appreciate any hints to get the ball rolling on this question or references to textbooks covering this.

Since $$\mu$$ is $$\sigma$$-finite, we can can write $$X = \bigcup_{n=1}^\infty X_n$$ with $$\mu(X_n) < \infty$$. We only need to show that $$f(x) \leq g(x)$$ for $$\mu$$-almost all $$x \in X_n$$ and all $$n \in \mathbb{N}$$.
Thus, let w.l.o.g. $$\mu$$ be a finite measure. Now let $$Y_n := \{ g \le n\}$$. Again, we only need to show the that $$f(x) \le g(x)$$ for almost all $$x \in Y_n$$ and $$n \in \mathbb{N}$$.
Therefore we can also assume additionally that $$g$$ is bounded, i.e. integrable. Now let $$A_\varepsilon := \{f \ge g + \varepsilon\}$$. The condition implies $$\int_{A_\varepsilon} g \, d \mu \ge \int_{A_\varepsilon} f \, d \mu \ge \varepsilon \mu(A_\varepsilon)+\int_{A_\varepsilon} g \, d \mu.$$ Since both sides are finite, this can only happen if $$\mu(A_\varepsilon) =0$$. All in all, we find $$\mu(f > g) = \mu( \bigcup_{n=1}^\infty \{f \ge g +1/n\}) \le \sum_{n=1}^\infty \mu(A_{1/n}) =0.$$
• A couple questions. First, how do you get that the integral of g over $A_\epsilon$ is greater than the integral of f over the same set? I see how the other inequality follows (from the definition of $A_\epsilon$) but I don’t see how the first appears without pre-supposing that $A_\epsilon$ is measurable (I don’t see how that is immediate). Second, was there a reason to define the $X_n, Y_n$’s? I don’t see how we use them. Finally, how does the fact that $\mu$ is $\sigma$-finite come into play? Nov 14, 2018 at 20:51
• Your conditions says that $\int_A f \, d \mu \le \int_A g \, d \mu$ for any measurable set $A \subset E$. Especially, we can take $A= A_\varepsilon$. Of course, $A_\varepsilon$ is measurable. Since $f,g$ are measurable $h:=f-g$ is also measurable. Now $A_\varepsilon$ is the pre-image of $[\varepsilon, \infty)$ under $h$ and thus measurable. In other words: $A_\varepsilon = h^{-1}([\varepsilon,\infty))$. Nov 14, 2018 at 21:25
• We have of course $\int_{A \cap Y_n \cap X_m} f \, d \mu \le \int_{A \cap Y_n \cap X_m} g \, d \mu$. Take instead of $A$ the measurable set $A \cap Y_n \cap X_m$. Thus, we can restrict to $X_m \cap Y_n$. This step is necessary in order to get an integrable $g$. (If $g$ is not-integrable, then both sides can be $\infty$ and we cannot conclude that $\mu(A_\varepsilon) =0$.) $X_m$ has finite measure and $g$ is bounded on $Y_n$. Hence, $g$ is integrable on $X_m \cap Y_n$. Nov 14, 2018 at 21:26
It is easy to reduce the proof to the case when $$E$$ has finite measure. Let $$f_N=\min \{f,N\}$$ and $$g_N=\min \{g,N\}$$. If we show that $$f_N \leq g_N$$ a.e. for each $$N$$ we are done. Replacing $$A$$ in the hypothesis by $$A_N\equiv A\cap \{f\leq N, g \leq N\}$$ we get $$\int_{A_N} f_N \leq \int_{A_N} g_N$$. In particular $$\int_{A_N} (g_N-f_N) \geq 0$$ when $$A=\{g [Note that $$\infty - \infty$$ does not appear here since the integrals are finite]. Can you now show that $$A_N$$ has measure $$0$$ (for every $$\epsilon >0$$) from this an conclude that $$f_N \leq g_N$$ a.e.?