Definition:Let $v:(a,b)\to\mathbb{R}$. If there exists a partition $P$ of the interval $(a,b)$ such that $v$ is constant in each subinterval of $P$, we say that $v$ is a step function.
Let $u:(0,1)\to\mathbb{R}$ be the function given by $u(x)=1/\sqrt{x}$. I'm trying to find a sequence $u_n:(0,1)\to\mathbb{R}$ of step functions that converges to $u$ almost everywhere.
I think I got a solution for some simplest cases, like $u(x)=x$, $u(x)=2x$, $u(x)=x^2$, by taking $$u_n(x)=\left\{\begin{matrix} u\left(\frac{1}{n}\right) & \text{if }0<x\leq\frac{1}{n}\\ u\left(\frac{2}{n}\right) & \text{if }\frac{1}{n}<x\leq\frac{2}{n}\\ \vdots& \\ u(1) & \text{if }\frac{n-1}{n}<x<1 \end{matrix}\right.$$ But I don't know how to solve the case $u(x)=1/\sqrt{x}$.
Thanks.
Consider the usual step function approach for $\left[\dfrac 1 n,1\right)$, let the step function be $0$ on $(0,n^{-1})$. That is, partition $[n^{-1},1)$ into small segments and take say the $\inf$ of your function to be the constant of the step in the interval. As $n$ grows larger, you will be able to approach $0$ nicely. Rememeber all we want is a pointwise limit. If you want to save some work, you can argue like this. For each $k$, there is a sequence of step functions $s_{k,n}$ that converge to $x^{-1/2}$ on $[k^{-1},1)$. Consider the sequence $t_n=s_{n,n}$ where we define the step to be $0$ where we didn't define it before.