Proof of integral of a simple measurable function I need to prove that for $x_{1}, x_{2}, \cdots $ and disjoint $A_{1}, A_{2}, \cdots $, for a simple measurable function $f(\omega) = \sum_{i=1}^{\infty}x_{i}I_{A_{i}}(\omega)$, $$ \int f d \mu = \int_{\Omega} f(\omega) d\mu = \sum_{i=1}^{\infty}x_{i}\mu(A_{i})$$
And I need to do so by using $$ \sup_{A_{1},\cdots , A_{n}} \sum_{i=1}^{n}\inf_{\omega \in A_{i}} f(\omega) \cdot \mu(A_{i}) = \int f d\mu = \int_{\Omega} f(\omega) d \mu(\omega) = \int_{\Omega}f(\omega)\mu(d\omega),$$
where $(\Omega,\mu)$ is a measure space, and $A_{i}$ is a partition of $\Omega$.
From this last statement, it appears that I need to show $\sup_{A_{1},\cdots , A_{n}} \sum_{i=1}^{n}\inf_{\omega \in A_{i}} f(\omega) \cdot \mu(A_{i}) =\sum_{i=1}^{\infty}x_{i}\mu(A_{i})$
And since $f(\omega) = \sum_{i=1}^{\infty}x_{i}I_{A_{i}}(\omega)$, this becomes a case of needing to show 
$$\sup_{A_{1},\cdots , A_{n}} \sum_{i=1}^{n}\inf_{\omega \in A_{i}}\sum_{i=1}^{\infty}x_{i}I_{A_{i}}(\omega)\cdot \mu(A_{i}) =\sum_{i=1}^{\infty}x_{i}\mu(A_{i}).$$
But I don't know how to do that. 
Could someone please help me figure out how to prove this? Thank you for your time and patience.
 A: It is important to write down what you know correctly and precisely before you start solving a problem and then think about the meaning of what you want to show.
You want to show that for the function $f=\sum_{i=1}^\infty x_i\cdot I_{A_i}$, the supremum of
\begin{align}
   \sum_{k=1}^n\inf_{\omega\in B_k}f(\omega)\cdot\mu(B_k) \tag{$*$}
\end{align}
over all $n$ and all partitions $B_1,B_2,\ldots,B_n$ of $\Omega$ is \begin{align}
   \sum_{i=1}^\infty x_i\mu(A_i) \;. \tag{$**$}
\end{align}
Now, let us consider a fixed partition $B_1,B_2,\ldots,B_n$.
What is the meaning of ($*$)?  Note that ($*$) is the integral of a simple function dominated by $f$.  Namely, for $\omega\in B_k$, let us define $g(\omega)$ to be the infimum of $f$ over $B_k$, that is, $g(\omega)=\inf_{\sigma\in B_k}f(\sigma)$.  Using indicator functions, we can represent $g$ by the formula
\begin{align}
   g(\omega) &:= \sum_{k=1}^n g_k\cdot I_{B_k}(\omega)
\end{align}
where $g_k:=\inf_{\sigma\in B_k}f(\sigma)$.
Then, ($*$) is simply the integral of $g$, that is, $\sum_{k=1}^n g_k\cdot\mu(B_k)$.
In order to show that the supremum of ($*$) is ($**$) you have to show two things:


*

*For each parition $B_1,B_2,\ldots,B_n$, the value ($*$) is no greater that ($**$).

*The value ($*$) can be made arbitrarily close to ($**$) by choosing the partition $B_1,B_2,\ldots,B_n$ appropriately.  Here, you have to consider three different cases, depending on whether ($**$) is $-\infty$, $+\infty$ or in $(-\infty,+\infty)$.


Now, you can try to see why (1) and (2) are true.  It will help if you think about a concrete example.  Say, consider an example in which $\Omega$ is the real line and choose $A_1,A_2,\ldots$ to be disjoint intervals.  Sketch the graph of $f$ and think about the meaning of the function $g$ for a particular partition $B_1,B_2,\ldots,B_n$.  (In your sketch, you may choose $B_1,B_2,\ldots,B_n$ to be intevals as well, although in your final proof, they do not need to be intervals.)
