TITLE: for each $\epsilon >0$ there is a $\delta >0$ such that whenever $m(A)<\delta$, $\int_A f(x)dx <\epsilon$
QUESTION [10 upvotes]: This is an old preliminary exam problem: 
Show that, for every nonnegative Lebesgue integrable function $f:[0,1]\rightarrow \mathbb{R}$ and every $\epsilon>0$ there exists a $\delta>0$ such that for each measurable set $A\subset [0,1]$ with $m(A)<\delta$ it follows that $\int_A f(x)dx<\epsilon$. 
Here's my attempt at a proof: Since $[0,1]$ is compact, and $f$ is real-valued, there exists an $M>0$ such that $f(x)\le M$ for all $x\in [0,1]$. Therefore, for $\epsilon>0$, let  $\delta=\epsilon/M$. Then for all  $A\subset [0,1]$ such that  $m(A)<\delta$,  we have that $\int_A f(x)dx\le Mm(A)<\epsilon$. Where here $m$ denotes Lebesgue measure.
The part I'm unsure about is the existence of $M$. If the function is continuous, then there is no problem, but $f$ does not have to be continuous to be Lebesgue measurable. On the other hand, the problem says that $f$ is real-valued, not extended real-valued, so this means that $f(x)$ is defined and finite for each $x$, right?

REPLY [6 votes]: Denote $E_n = \{x: f(x) \geq n\}$. Since $f$ is integrable then $f$ is finite a.e. So we have $f(x)\chi_{E_n}(x) \to 0$ for a. e $x$. Moreover $0 \leq f \chi_{E_n} \leq f$, by the dominated convergence theorem, we have
$$\lim_{n\to\infty}\int_{E_n} f dm =0.$$
For any $\epsilon >0$, we choose $N> 0$ such that $\int_{E_N} f dm < \epsilon/2$. Choosing $\delta = \epsilon/2N$, then for any subset $E$ such that $m(E) < \delta$ we have
$$\int_E fdm = \int_{E\cap E_N} f dm +\int_{E\setminus E_N} fdm \leq \int_{E_N} fdm +N m(E\setminus E_N) < \frac{\epsilon}2 +\frac{\epsilon}2 =\epsilon.$$