This is an exercise problem from durrett (1.4.2), 4th edition:
Let $f\geq 0$ and $E_{n,m}=\{x:m/2^n \leq f(x) <(m+1)/2^n\}$. Then $$\sum_{m=0}^{\infty} m/2^n \mu(E_{n,m})\to \int f d \mu$$ as $n\to \infty$.
When I try to prove this example, I kind of set the function $g_n=\sum_{m=1}^{\infty}m/2^n\mathbb{I}_{E_{n,m}}$.
But g is neither a simple function nor a bounded function with bounded support, I don't know how to prove that $\int g_n d\mu=\sum_{m=0}^{\infty} m/2^n \mu(E_{n,m})$
By the way, I don't want to prove this through the convergence theorem, because by the setting of the textbook, this should be proved by definition of Lebesgue interal.
Here's a sketch of what you should be doing:
Consider the simple function $$ \phi_n(x)=\begin{cases} m/2^n,&m/2^n\leq f(x)<(m+1)/2^n \\ n,&f(x)\geq n \end{cases} $$ This function is a simple function with $\phi_n(x)\leq g_n(x)\leq f(x)$ for all $x$. It should be clear that for $x$ such that $f(x)<\infty$, for sufficiently large $n$, we have $|f(x)-\phi_n(x)|\leq 2^{-n}$ (eventually, $n>f(x)$ so $m/2^n\leq f(x)< (m+1)/2^n$ will hold). Hence, $\phi_n(x) \uparrow f(x).$ If $f(x)=\infty$, then $\phi_n(x)=n \uparrow f(x)$.
Now, using the definition $\displaystyle \int f=\sup_{0\leq s \leq f \\ s \text{ simple }}\int s,$ it is easy to prove that $\displaystyle \int f=\lim_{n\to\infty} \int \phi_n$. Without knowing dominated convergence theorem, monotone convergence theorem, etc. the aforementioned limit (which may be $+\infty$) still exists since $\int \phi_n$ is a monotone increasing sequence of real numbers.
Finally, the trick is observing that $$\{x: f(x)\geq n\}=\cup_{m=n2^n}^\infty E_{n,m}.$$ Hence, although $\phi_n$ is simple, it has the representation $$ \phi_n=\sum_{m=0}^{n2^n-1}m/2^n \mathbb{1}_{E_{n,m}}+\sum_{m=n2^n}^\infty n \mathbb{1}_{E_{n,m}}. $$ See if you can fill in the details and apply a squeeze theorem argument.