Series representation of measurable functions I need to show that if a positive function $f$ on $E$, where $(E,\mathcal{E})$ is a measurable space, is $\mathcal{E}$-measurable then it has the form
$$f=\sum_{n=1}^{\infty}a_n1_{A_n},$$
for some sequence $(a_n)\subset \bar{\mathbb{R}}_{+}$ and some sequence $(A_n)\subset \mathcal{E}$ (not necessarily disjoint). 
Since $f$ is measurable and positive it is a pointwise limit of an increasing sequence of positive simple functions, that is
$$f(x)=\lim_{k\to\infty}\sum_{n=1}^ka_{n,k}1_{B_{n,k}}(x),\ \forall x\in E,$$
where for all $k$ we can assume $(B_{n,k})_{1\leq n\leq k}\subset \mathcal{E}$ are pairwise disjoint. I'm having trouble understanding what $a_n$'s and $A_n$'s should be since I think that $\lim_{k\to\infty}a_{n,k}$ need not exist (the sets $B_{n,k}$ and $B_{n,k+1}$ can be disjoint).
 A: First of all, note that it suffices to consider the case that $0 \leq f \leq 1$. Indeed: Suppose that the claim holds for any measurable $f$ such that $0 \leq f \leq 1$. Let $g$ be an arbitrary non-negative function. We can write
$$g = \sum_{k=0}^{\infty} 1_{\{k \leq g < k+1\}} \cdot g.$$
Then $0 \leq (g -k) 1_{\{k \leq g < k+1\}} \leq 1$ and we have (by assumption) an representation of the form
$$(g-k) 1_{\{k \leq g < k+1\}} = \sum_{n=1}^{\infty} a_{n,k} 1_{A_{n,k}}.$$
Thus,
$$g 1_{\{k \leq g < k+1\}} = \sum_{n=1}^{\infty} a_{n,k} 1_{A_{n,k}} + k 1_{\{k \leq g < k+1\}} = \sum_{n=0}^{\infty} a_{n,k} 1_{A_{n,k}}$$
if we set $a_{0,k} = k$ and $A_{0,k} = \{k \leq g < k+1\}$. Finally, we conclude
$$g = \sum_{k \geq 0} g 1_{\{k \leq g < k+1\}} = \sum_{k \geq 0} \sum_{n \geq 0} (a_{n,k}+k) 1_{A_{n,k}}.$$

It remains to prove the claim for measurable $f$ such that $0 \leq f \leq 1$. By the Sombrero lemma, there exists a simple function $g_1$ such that $0 \leq f-g_1\leq \frac{1}{2}$. Note that $f-g_1$ is again a non-negative (measurable) function and therefore, we can choose a simple function $g_2$ such that $0 \leq (f-g_1)-g_2 \leq \frac{1}{2^2}$. Iterating this procedure we find a sequence $(g_n)_{n \in \mathbb{N}}$ of simple functions satisfying
$$0 \leq f - \sum_{j=1}^k g_j \leq \frac{1}{2^k}.$$
This proves in particular $f = \sum_{j=1}^{\infty} g_j$. On the other hand, it is clear that for each $j \in \mathbb{N}$ we can write
$$g_j = \sum_{i=1}^{N(j)} a_{i,j} 1_{A_{i,j}}.$$
Consequently,
$$f = \sum_{j=1}^{\infty} g_j = \sum_{j=1}^{\infty} \sum_{i=1}^{N(j)} a_{i,j} 1_{A_{i,j}}.$$
This yields the desired representation for $f$.


Sombrero lemma: Let $(E,\mathcal{A})$ be measurable space and $f: E \to \mathbb{R}$ be a non-negative mesasurable function. Then there exists a sequence of simple functions $(f_n)_n$ such that $0 \leq f_n \leq f$ and $f_n \uparrow f$. If $f$ is bounded, the convergence is uniformly.

Proof: For $n \in \mathbb{N}$ we define
$$f_n(x) := \begin{cases} k 2^{-n}, & \text{if} \, x \in \{k 2^{-n} \leq f < (k+1) 2^n\} \, \text{for some} \, k \in \{0,\ldots,2^{2n}\} \\  2^n, & \text{otherwise}, \end{cases}$$
so, basically, $f_n(x) = k 2^{-n}$ if $f(x) \in [k 2^{-n},(k+1) 2^{-n})$. Obviously, $f_n$ is a simple function, $f_n \leq f$ and $f_n \uparrow f$. If $f$ is bounded, then we have
$$f_n(x) := \begin{cases} k 2^{-n}, & x \in \{k 2^{-n} \leq f < (k+1) 2^n\} \, \text{for some} \, k \in \{0,\ldots,2^{2n}\}  \end{cases}$$
for $n$ sufficiently large. In particular, $0 \leq f(x)-f_n(x) \leq 2^{-n}$ for any $x \in E$. This shows the uniform convergence.
Literature: René L. Schilling: Measures, integrals and martingales. Cambridge University Press, 2011.
