I read (p. 405 here) that a continuous function on $[a,b]$ can be arbitrarily approximated according to the distance of space $L^2[a,b]$ defined by $d(f,g):=\|f-g\|_2=\int_{[a,b]}|f-g|^2d\mu$ with $\mu$ as the linear Lebesgue measure, a function constant on intervals of length $\frac{b-a}{2^n}$ for $n$ large enough (of course Riemann's integral coincide with Lebesgue's for such functions).
I would even imagine that $f$ can be uniformly approximated on $[a,b]$ by such functions, but I cannot manage to prove it...
Is this intuition correct and, if it is, how can the uniform approximation be proved? If it is not correct, how can the arbitrary approximation with respect to norm $\|\cdot\|_2$ be proved? Thank you so much!!!
O.T.: I cannot to resist to say a word about the void left by Alexander Grothendieck. His work has made him immortal.
Since $f$ is continuous on a compact interval, it is uniformly continuous. Hence for $\epsilon>0$ there exists $\delta>0$ such that $|x-y|\le\delta$ implies $|f(x)-f(y)|<\epsilon$. Then an obvious pick of step fucntion $g$ with step size $\frac{b-a}{2^n}<\delta$ does the trick for uniform approximation up to $\epsilon$.