Lebesgue Integration definition approximation by simple functions Let $\mathcal{L}_+^{simp,0}(S,\mathcal{S},\mu)$ be The collection of all simple functions.
For each $f\in \mathcal{L}_+^0$, where $\mathcal{L}_+^0$ is the set of all measurable $[0,\infty]$-valued functions, there exists a sequence $\{g_n\}_{n\in\mathbb N}\in g\in \mathcal{L}_+^{simp,0}$ such that $g_n(x)\leq g_{n+1}(x)$ for all $n\in \mathbb N$ and all $x\in S$.
I saw in a couple of references they use the following definition for $g_n(x)$
$$g_n=\sum_{k=1}^{n2^n} \frac{k-1}{2^n}\chi_{A_k^n}+n\chi_{\{f\geq n\}}$$
where 
$$A_k^n=\left\{\frac{k-1}{2^n}\leq f< \frac{k}{2^n}\right\}=f^{-1}\left([\frac{k-1}{2^n},\frac{k}{2^n})\right),k=1,_{\cdots},n2^n$$
But I can't seem to show that $g_n(x)\leq g_{n+1}(x)$ for all $n\in \mathbb N$ and all $x\in S$.
How do I show that?
 A: In my answer I give a formal proof that $g_n \leq g_{n+1}$. To get some intuition it is, however, much more useful to draw a picture.

Fix $n \in \mathbb{N}$. If $x \in A_k^n = \left\{ \frac{2(k-1)}{2^{n+1}} \leq f < \frac{2k}{2^{n+1}} \right\}$ for some $k \in \{1,\ldots,n 2^n\}$, then either
$$x \in \left\{\frac{2k-2}{2^{n+1}} \leq f < \frac{2k-1}{2^{n+1}} \right\} = A_{2k-1}^{n+1} \tag{1}$$
or
$$x \in \left\{\frac{2k-1}{2^{n+1}} \leq f < \frac{2k}{2^{n+1}} \right\} = A_{2k}^{n+1}. \tag{2}$$
We consider the two cases separately. Recall that $g_n(x) = (k-1) 2^{-n}$. If $(1)$ holds, i.e. $x \in A_{2k-1}^{n+1}$, then, by the definition of $g_{n+1}$, we have $g_{n+1}(x) = (2k-2)/2^{n+1}$, i.e.
$$g_n(x) = \frac{k-1}{2^n} = \frac{2 (k-1)}{2^{n+1}} = g_{n+1}(x).$$
On the other hand, if $(2)$ holds, i.e. $x \in A_{2k}^{n+1}$, then $g_{n+1}(x) = (2k-1)/2^{n+1}$ and so
$$g_n(x) = \frac{k-1}{2^n} \leq \frac{2k-1}{2^{n+1}} = g_{n+1}(x).$$
Since $k$ is arbitrary, this shows that $g_n(x) \leq g_{n+1}(x)$ for any $x \in \{0 \leq f < n\}$. For $x \in \{f \geq n\}$ the reasoning is very similar; I leave it to you.
