# How to prove this problem about integrable function?

If an integrable function $f(x)\ge0$ a.e., then $\int fd\mu\ge0$. Any hint is appreciated.

-
Suppose not ... – Cantor Dec 10 '12 at 18:54
Sorry, I still cannot figure it out. – Sam Dec 10 '12 at 19:14
Would be you be able to prove the statement if $f(x) \geq 0$ instead of $f(x) \geq 0$ a.e. ? (This is such a fundamental question, that we need to know exactly where you are having trouble to provide useful comments) – madprob Dec 10 '12 at 19:16
Use the definition of the integral, it will follow directly. – Amr Dec 10 '12 at 19:20
What is the definition of $\int f d\mu$? – Cantor Dec 10 '12 at 20:00

$A=\{x;f(x)\ge0\}=\cup\{x;f(x)\ge\frac1n\}=\cup A_n$. $$\int_{A}fd\mu\ge\int_{A_n}fd\mu\ge\int_{A_n}\frac1nd\mu\ge\frac1n\mu(A_n)\ge0.$$
$B=\{x;f(x)<0\}=\cup\{x;f(x)<-\frac1n\}=\cup B_n$. $$\int_{B}fd\mu=-\int_{B}f^-d\mu.$$ $f^-\ge0\Rightarrow \exists$ a sequence of nonnegative simple functions $\varphi_n\nearrow f^-$ and $\varphi_n$ can be represented as a linear combination of characteristic functions. $$0\le\int_{B}\varphi_nd\mu=\int_{B}\sum_{k=1}^ma_k\mathbf{1}_{E_k}d\mu=\sum_{k=1}^ma_k\mu(E_k\cap B)\le\sum_{k=1}^ma_k\mu(B)=0.$$ $\Rightarrow \int_{B}\varphi_nd\mu=0\Rightarrow \int_{B}f^-d\mu=0$ as $n\to\infty\Rightarrow\int_{B}fd\mu=0\Rightarrow \int fd\mu\ge0$.