A Basic Question about Integrals I have a basic question about integrals. Suppose that $f: [0,1] \mapsto \mathbb{R}$ is a bounded function. Do not assume that $f$ is continuous. For each $n \geq 1$, define $f_n: [0,1]\mapsto \mathbb{R}$ by:
$$f_n(x) = \sum_{j=1}^n n\int_{\frac{j-1}{n}}^{\frac{j}{n}} f(y) dy ~\mathbf{1}\left(\frac{j-1}{n}< x \leq \frac{j}{n}\right)~.$$
$f_n$ may be thought of as an $n-$step piecewise approximation of $f$. My question is:
Is it true that $\int_0^1|f_n(x)-f(x)| dx \rightarrow 0$ as $n\rightarrow \infty$? Also, does this answer depend on whether the integrals in question are Riemann or they are Lebesgue (in the sense of integration w.r.t. the Lebesgue measure)? 
Any help will be appreciated! Thanks.

This reduces for a bounded Riemann integrable function to
$$\begin{align}\int_0^1 |f(x) - f_n(x)| \, dx &= \sum_{j=1}^n \int_{\frac{j-1}{n}}^{\frac{j}{n}}\left|f(x) - n\int_{\frac{j-1}{n}}^{\frac{j}{n}}f(y) \, dy  \right| \, dx \\ &= n\sum_{j=1}^n \int_{\frac{j-1}{n}}^{\frac{j}{n}}\left|\frac{f(x)}{n} - \int_{\frac{j-1}{n}}^{\frac{j}{n}}f(y) \, dy  \right|\, dx \\ &= n\sum_{j=1}^n \int_{\frac{j-1}{n}}^{\frac{j}{n}}\left|\int_{\frac{j-1}{n}}^{\frac{j}{n}}[f(x) - f(y)] \, dy  \right|\,dx \\ &\leqslant n\sum_{j=1}^n \int_{\frac{j-1}{n}}^{\frac{j}{n}}\int_{\frac{j-1}{n}}^{\frac{j}{n}}|f(x) - f(y)| \, dy \, dx  \\ &\leqslant n\sum_{j=1}^n \frac{\sup_{x,y \in \left[\frac{j-1}{n},\frac{j}{n}\right]} |f(x) - f(y)|}{n^2} \\ &= \frac{1}{n}\sum_{j=1}^n \sup_{x \in \left[\frac{j-1}{n},\frac{j}{n}\right]} f(x) - \frac{1}{n}\sum_{j=1}^n \inf_{x \in \left[\frac{j-1}{n},\frac{j}{n}\right]} f(x) \end{align}$$
The RHS is a difference of upper and lower sums which converges to $0$ as $n \to \infty$. 
The steps leading to the final difference of sums are valid if $f$ is bounded and Lebesgue integrable. I'll leave it to you to determine if the limit is always $0$ in case $f$ is Lebesgue but not Riemann integrable.  Can you think of a counterexample?
