Approximation of continuous function by uniform convergence of piecewise constant functions

51 Views Asked by At

I am reading Analysis 2 by Terence Tao, and I have a question regarding approximating continuous functions by piecewise constant functions.

Suppose that $f\in C(\mathbb{R})$. Can you find a sequence of piecewise constant functions $(f_n)$ such that $f_n$ converges to $f$ $\textbf{uniformly}$? I know that this can be done such that $f_n$ converges pointwise, but I am not sure about uniform convergence. My intuition tells me that I can do this when $f$ has a bounded support, but I am not sure. Any hints would be appreciated.