# Finding an increasing sequence of step functions which converges pointwise everywhere to $χ_{[0,1]\cap\mathbb Q}(x)·x$

Find an increasing sequence of step functions which converges pointwise everywhere to the function$$f(x)=\chi_{[0,1] \cap \Bbb Q} (x) · x.$$

I know how to approximate a non-negative measurable function by an increasing sequence of non-negative simple functions. But I do not know the way of approximating any non-negative measurable function by an increasing sequence of step functions. Would anybody please help me finding this? Actually I want to know the geometrical approach behind that kind of approximations which will enable me to solve these types of problems on my own.

Thank you very much.

• I would suggest that you think about what a nonnegative step function which is less than $f$ can look like. Can you write down any interesting examples? – Eric Wofsey Apr 30 '18 at 4:35
• Then $g$ is a step function for all $n \in \Bbb N$ such that $g(x) \leq f(x)$ for all $x \in \Bbb R$. Isn't it so @Eric Wofsey? – Dbchatto67 Apr 30 '18 at 5:36
• No. $g(x)\not\leq f(x)$ if $x\in (1/n,1)$ is irrational. – Eric Wofsey Apr 30 '18 at 6:26
• Oh! I see. I am trying to prove by taking degenerate step function as no restriction is given in the question. – Dbchatto67 Apr 30 '18 at 6:46

Since a singleton in $\mathbb{R}$ is a degenerate interval, defining$$A_m = \{ k \in \mathbb{Z} \mid 1 \leqslant k \leqslant m,\ (k, m) = 1 \},\\ f_n(x) = \sum_{m = 1}^n \sum_{k \in A_m} \frac{k}{m} χ_{\{\frac{k}{m}\}}(x),$$ then $\{f_n\}$ is an increasing sequence of step functions and converges to $f$ pointwise.
• @DebabrataChattopadhyay. I don't know if this constitutes geometric intuition, but the idea is to first divide the domain of $f$ into intervals of certain length and then replace the value of $f$ by some value in each interval, thus resulting in a step function. By choosing finer and finer intervals, a sequence of step functions for approximation is derived. – Saad May 6 '18 at 14:00