# real analysis – Show \$lim_n frac{1}{2^n}sum_{j=1}^{2^{2n}} chi_{{f > j/2^n}}= f\$ pointwise.

Let $$f geq 0$$ be a function. Show that

$$lim_n frac{1}{2^n}sum_{j=1}^{2^{2n}} chi_{{f > j/2^n}} = f$$ pointwise. Here $$chi_A$$ is the indicator function on the set $$A$$ and $${f > j/2^n}:= {x : f(x) > j/2^n}$$

Attempt:

I’m a bit lost here. The sum looks really complicated and it’s hard to see for me what’s going on.
I tried to estimate $$|f(x)- frac{1}{2^n}sum_{j=1}^{2^{2n}} chi_{{f > j/2^n}}(x)|$$
but could not get anything that becomes small.