How prove this $\int_{0}^{1}|f(x)|dx\le2$ 
let  $f$ be Riemann integable in $[0,1]$, and for any $[a_{i},b_{i}]\subset [0,1]$,and $[a_{i},b_{i}]\bigcap [a_{j},b_{j}]= \emptyset,1\le i\neq j\le n$
  then have
  $$|\sum_{i=1}^{n}\int_{a_{i}}^{b_{i}}f(x)dx|\le 1$$

show that

$$\int_{0}^{1}|f(x)|dx\le2$$

This problem is my younger brother ask me, But I can't use the methods to prove this ? 
Thank you 
 A: By $\lambda$ we denote Lebesgue measure on $[0,1]$. Since $f$ is Riemann integrable, then there exist $M>0$ such that $|f(x)|<M$ for all $x\in[0,1]$
Let $A_+=\{x: f(x)>0\}$. Since $f$ is Riemann integrable $A_+$ is Lebesgue measurable. Fix $\varepsilon>0$, then there exist finite family $\{[a_i,b_i]\}_{i=1}^n$ of disjoint segments such that $\lambda\left(\bigcup_{i=1}^n [a_i,b_i]\setminus A\right)\leq\varepsilon$ and $A\subset\bigcup_{i=1}^n [a_i,b_i]$. Then,
$$
\begin{align}
0\leq\int_{A_+} f(x)d\lambda(x)
&=\int_{\bigcup_{i=1}^n [a_i,b_i]} f(x)d\lambda(x)+\int_{\bigcup_{i=1}^n [a_i,b_i]\setminus A} f(x)d\lambda(x)\\
&\leq\sum\limits_{i=1}^n\int_{[a_i,b_i]}f(x)d\lambda(x)+\int_{\bigcup_{i=1}^n [a_i,b_i]\setminus A} M d\lambda(x)\\
&=\sum\limits_{i=1}^n\int_{a_i}^{b_i}f(x)dx +M\lambda\left(\bigcup_{i=1}^n [a_i,b_i]\setminus A\right)\\
&\leq 1+M\varepsilon\\
\end{align}
$$
Since $\varepsilon>0$ is arbitrary we get that 
$$
0\leq\int_{A_+}f(x)d\lambda(x)\leq 1\tag{1}
$$
Similarly one can show that for $A_-=\{x\in[0,1]: f(x)<0\}$ we have
$$
-1\leq\int_{A_-}f(x)d\lambda(x)\leq 0\tag{2}
$$
Clearly for $A_0=\{x\in[0,1]:f(x)=0\}$ we have
$$
\int_{A_0} f(x)d\lambda(x)=0\tag{3}
$$
Now from $(1)$, $(2)$ and $(3)$ we derive
$$
\int_0^1 |f(x)|dx=
\int_{[0,1]} |f(x)|d\lambda(x)=
\int_{A_+} f(x)d\lambda(x)+\int_{A_0} f(x)d\lambda(x)-\int_{A_-} f(x)d\lambda(x)
\leq 2
$$
A: (a) First choose all of your $[a_i,b_i]$'s such that you integrate over all of the regions where $f(x)>0$ and this tells you that this integral (the first equation shown in your question) is at most 1.
(b) Now choose all of your $[a_i,b_i]$'s such that you integrate over all of the regions where $f(x)\le0$ and this tells you that the magnitude of this integral is at most 1. (i.e. the integral is at least -1)
Hence it follows that integrating the magnitude of $f(x)$ over all of $[0,1]$ amounts to the integral of $f(x)$ everywhere where $f(x)$ is positive (i.e. (a)) as well as the magnitude of the integral of $f(x)$ everywhere where $f(x)$ is negative (i.e. (b)).
It follows therefore that this integral is at most 2.
