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.
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}}$.