How to verify $0\leq f_n(x) \leq f_{n+1}(x)\leq\dots$ From Mathematical Analysis By Andrew Browder1)

10.6 Lemma. If $f$ is a nonnegative measurable function, then there exists a sequence $(f_n)$ of nonnegative simple measurable functions, such that $0\leq f_n(x) \leq f_{n+1}(x)$ for all $n \in \mathbf{N}$ and all $x \in X$, and such that $\lim f_n(x) = f(x)$ for all $x \in X$.
Proof. It suffices to put
$$ f_n = \sum_{k=1}^{n2^n} \frac{k-1}{2^n} \mathbf{1}_{A_{n,k}} + n\mathbf{1}_{B_n}, $$
where $A_{n,k}=\{x : (k-1)2^{-n} < f(x) \leq k2^{-n} \}$ and $B_n =\{ x : f(x) > n \}$. It is routine to verify that the sequence $(f_n)$ has the desired properties.

Here, I am unable to prove $0\leq f_n(x) \leq f_{n+1}(x)\leq \dots$
I tried like: If $x \in \cup_{k=1}^{n2^n}A_{(n,k)}$,then $x \in A_{(n,j)}$ for some $j$
Then $f_n(x)=\frac{j-1}{2^n}$
now $f_{n+1}=\sum_{k=1}^{(n+1)2^{(n+1)}}\frac{k-1}{2^{n+1}}1_{A_{(n+1,k)}} + (n+1)1_{B_{(n+1)}}$
Here,I can use say,$x \notin B_n$$\implies x \notin B_{(n+1)}\implies x \in (B_{n+1})^c$
Using $(B_n)^c=\cup_{k=1}^{n2^n}A_{(n,k)}$ I have $(B_{n+1})^c=\cup_{k=1}^{(n+1)2^{n+1}}A_{(n+1,k)}$
So,$x \in A_{(n+1,l)}$ for some $l$
so we will have $f_{n+1}(x)=\frac{l-1}{2^{n+1}}$
But,now how should I proceed further to show,$f_n(x) \leq f_{n+1}(x)$.
Thanks in advance.
 A: Define $\phi : [0, \infty) \to [0, \infty)$ by
$$ \phi(x) = \max\{0, \lceil x \rceil - 1\} = \begin{cases}
n-1, & \text{if $n-1 < x \leq n$ for some $n \in \{1, 2, 3, \dots\}$}; \\
0, & \text{if $x = 0$}.
\end{cases} $$
Then by noting that
$$A_{n,k} = \{ x : \phi(2^n f(x)) = k-1 \} \quad\text{for} \quad k = 1, \dots, n2^n$$
and
$$B_n = \{ x : \phi(2^n f(x)) \geq n 2^n\}, $$
we obtain the following simple representation:
$$ f_n(x) = \min\bigg\{ \frac{\phi(2^n f(x))}{2^n}, n \biggr\} $$
Then the desired conclusion easily follows from the easy observations:

*

*$2\phi(x) \leq \phi(2x)$ holds for all $x \geq 0$.


*If $a_1 \leq a_2$ and $b_1 \leq b_2$, then $\min\{a_1, b_1\} \leq \min\{a_2, b_2\}$.
A: The main point of this sequence of partitions is that they are nested, the next partition refines the previous. Since on a region $A_{(n,j)}$ we make $f_n$ assume the minimal possible value, refining the partition will make $f_{n+1}$ larger, since $\min A \cup B \le \min (\min A, \min B)$.
More formally, if $x \in A_{(n,j)}$ then $\frac{j-1}{2^n} < f(x) \le \frac{j}{2^n}$ and thus when we look at $n+1$ we see that
$$\frac{2j-2}{2^{n+1}} < f(x) \le \frac{2j}{2^{n+1}}$$ and $x$ must belong to either $A_{(n+1,2j-1)}$ or $A_{(n+1,2j)}$, implying $f_{n+1}(x) = \frac{2j-2}{2^{n+1}}$ or $\frac{2j-1}{2^{n+1}}$.
