Limit and integral Let $\Omega = \mathopen]0,1\mathclose[$ and let a function $A_n: \Omega \to \mathbb R$ defined as:
$$A_n(x) = \begin{cases}\alpha &\text{if } k \epsilon \leq x < (k+\tfrac{1}{2}) \epsilon \\
\beta &\text{if } \big(k+\tfrac{1}{2}\big) \epsilon \leq x < (k+1) \epsilon
\end{cases} $$ 
for $k=0$, $1,\ldots,n-1$ where $\alpha$, $\beta > 0$ and $\epsilon=1/n$.
Let $f: [0,1] \rightarrow \mathbb{R}$ be a continuous function. How can we prove that  $$\lim_{n \to \infty} \int_0^1 A_n(x) f(x) dx = \lim_{n \to\infty} \sum_{k=0}^{n-1} \left(\alpha \int_{k \epsilon}^{(k+1/2)\epsilon} f(x) dx + \beta \int_{(k+1/2)\epsilon}^{(k+1)\epsilon} f(x) dx\right) \\= \dfrac{\alpha + \beta}{2} \int_0^1 f(x) dx$$
Thanks for your help.
 A: Hints:


*

*All you need to prove is that
$$
\lim_{n\to\infty} \sum_{k=0}^{n-1}\int_{k/n}^{(k+1/2)/n} f(x)\,dx = \frac{1}{2}\int_0^1 f(x)\,dx
$$

*Remember that (Riemann's sums theorem)
$$
\lim_{n\to\infty} \sum_{k=0}^{n-1} \frac{1}{n}f(k/n)\,dx = \int_0^1 f(x)\,dx
$$

*By using the uniform continuity of $f$, you can justify an estimate of the type
$$
\int_{k/n}^{(k+1/2)/n} f(x)\,dx \simeq \frac{f(k/n)}{2n}
$$
for large values of $n$, uniformly in $k$.

Extension to the case $f\in L^1[0,1]$
Use the density of continuous functions in $L^1[0,1]$ and the fact that for all $n$ we have
\begin{equation}
\left|\int_0^1A_n(x)f(x)\,dx - \int_0^1A_n(x)g(x)\,dx\right| \leq \max\{|\alpha|,|\beta|\} \|f-g\|_{L^1}
\end{equation}
hence
$$
\left|\langle A_n,f\rangle - \frac{\alpha+\beta}{2}\int_0^1 f\right| \leq C_{\alpha,\beta} \|f-g\|_{L^1} + \left|\langle A_n,g\rangle - \frac{\alpha+\beta}{2}\int_0^1 g\right|
$$
where $C_{\alpha,\beta}=\max\{|\alpha|,|\beta|\}+\frac{\alpha+\beta}{2}$.
Thus, for every $g$ continuous we have (according to what you did in the first part)
$$
\limsup_{n\to\infty} \left|\langle A_n,f\rangle - \frac{\alpha+\beta}{2}\int_0^1 f\right| \leq C_{\alpha,\beta} \|f-g\|_{L^1}
$$
and $\|f-g\|_{L^1}$ can be made as small as necessary, so finally
$$
\limsup_{n\to\infty} \left|\langle A_n,f\rangle - \frac{\alpha+\beta}{2}\int_0^1 f\right| = 0
$$
