$f$ is Rieman integrable $\iff$ $f$ is regulated?

We say that $$f$$ is regulated on $$[a,b]$$ if there is a sequence of step function $$(f_n)$$ on $$[a,b]$$ s.t. $$f_n \to f$$ uniformly.

Does this statement hold : $$f:[a,b]\to \mathbb R$$ is Riemann integrable on $$[a,b]$$ $$\iff$$ $$f$$ is regulated.

If $$f$$ is regulated, it's obviously Riemann integrable.

Q1) But what happen for the implication ? Let $$f$$ integrable, then of course $$\lim_{n\to \infty }\sum_{i=0}^{n-1}M_i\boldsymbol 1_{[x_i,x_{i+1}]}=f(x)$$ for all $$x\in [a,b]$$ where $$M_i=\max_{[x_i,x_{i+1}]}f$$, but I have difficulties to prove that the convergence is uniform.

Q2) If instead of $$[a,b]$$ we have $$[0,\infty )$$ does the statement is still true ? For example, let $$f$$ a regulated function on $$[0,\infty )$$, i.e. there is a sequence of step functions $$(f_n)$$ that converge uniformly to $$f$$. Now, $$\lim_{n\to \infty }\int_0^\infty f_n=\lim_{n\to \infty }\lim_{M\to \infty }\int_0^M f_n(x)dx,$$ and I dont really see why we can permute $$\lim_{n\to \infty }$$ and $$\lim_{M\to \infty }$$.

The function $$f(x)=\begin{cases} \sin\frac{1}{x} & 0
is Riemann integrable on $$[0,1]$$ but it is not regulated.
• $\sin(1/x)$ is really Riemann integrable on $[0,1]$ ? – user657324 Mar 30 at 15:30
• Thanks! The point is that the class of regulated functions is more restrictive because the convergence of the step functions must be $uniform.$ – Matematleta Mar 30 at 15:39
Q1 has been answered, with a simpler counterexample than the one I had in mind. For Q2: Define $$f:[0,\infty)\to[0,1]$$ by $$f(t)=1$$. Then $$f$$ iis regulated but not (improper) Riemann integrable on $$[0,\infty)$$.