Show that $\lim_{n\to \infty}\int_{0}^{1}g(x)f(nx)dx = \Big(\int_{0}^{1}g(x)dx\Big)\Big(\int_{0}^{1}f(x)dx\Big)$ This is a question I've encountered in a homework sheet, and I do not even know where to begin:

Let $f:[0, \infty) \rightarrow \mathbb R$ be a continuous real valued function such that  $f(x+1)=f(x)$ for all $x\ge0$. If $g:[0,1] \rightarrow \mathbb R$ is an arbitrary continuous function, show that $$\lim_{n\to \infty}\int_0^1g(x)f(nx)\,dx = \left(\int_0^1g(x)\,dx\right)\left(\int_0^1f(x)\,dx\right).$$

We were given a hint:

$$\int_0^1 g(x)f(nx)\,dx = \frac{1}{n} \sum_{i=1}^n \int_{i-1}^i g\left(\frac{u}{n}\right)f(u)\,du,$$ and put $t = u - i + 1.$

I have absolutely no idea where to begin. My thoughts are that this question will involve the use of Lebesgue's convergence theorem, and perhaps the monotone convergence theorems. I have a very basic understanding of these theorems but still struggle when they need to be applied. My understanding is that:

*

*Function must be Riemann Integrable

*$f_n \rightarrow f$ almost everywhere

*$|f_n| \le g \in L^1$
I understand 1., and kind of understand 3. but I'm never able to prove 2. without any help. In fact, I only have a vague understanding of 2. and 3.
I've attempted many questions, but just cannot finish one without help. My take is that I lack basic understanding on measure theory and I also lack practice, although I've been spending a large portion of time on this subject this semester. Everything is new and extremely difficult. I'd appreciate some books on the subjects, the lecture notes are really good, but I don't think it's enough at this point. I want something better than a mere pass (and if I aim for a pass, I will fail the subject) -- I want to actually understand it.
Any help and recommendations are appreciated. Thanks!
 A: Proof. Let us only assume that $f$ is Lebesgue integrable on $[0, 1]$ and $g$ is Riemann integrable on $[0, 1]$, as this generalization rarely harm the essence of the argument. Then
$$ \int_{0}^{1} f(nx)g(x) \, dx
\stackrel{nx=u}{=} \frac{1}{n}\int_{0}^{n} f(u)g\left(\frac{u}{n}\right)\,du
= \frac{1}{n}\sum_{i=1}^{n} \int_{i-1}^{i} f(u)g\left(\frac{u}{n}\right)\,du. $$
Substituting $v = u-i+1$, we get
$$ \int_{0}^{1} f(nx)g(x) \, dx
= \int_{0}^{1} f(v) \left[ \frac{1}{n}\sum_{i=1}^{n}  g\left(\frac{v+i-1}{n}\right) \right] \,dv. $$
Now write $\Pi_n = \{0, \frac{1}{n}, \cdots, \frac{n-1}{n}, 1\}$ and let $U_n = U(g, \Pi_n)$ and $L_n = L(g, \Pi_n)$ denote the upper Riemann sum and the lower Riemann sum for $\Pi_n$, respectively. Then $U_n$ and $L_n$ converge to the integral $I := \int_{0}^{1} g(x) \, dx$ as $n\to \infty$. Moreover,
$$ \forall v \in [0, 1] \ : \quad L_n \leq \frac{1}{n}\sum_{i=1}^{n}  g\left(\frac{v+i-1}{n}\right) \leq U_n . $$ 
Of course we also have $L_n \leq I \leq U_n$. So
$$ \left| \frac{1}{n}\sum_{i=1}^{n}  g\left(\frac{v+i-1}{n}\right) - I \right| \leq U_n - L_n  $$
and therefore
$$ \left| \int_{0}^{1} f(nx)g(x) \, dx - I \int_{0}^{1} f(v) \, dv \right| \leq (U_n - L_n) \int_{0}^{1} |f(v)| \, dv \xrightarrow[n\to\infty]{} 0. $$

Idea. Loosely speaking, $g$ hardly changes its value while $f(nx)$ completes one period on an interval of length $\frac{1}{n}$. In this way, behaviors of $g(x)$ and $f(nx)$ are almost decoupled for large $n$. ($g(x)$ can only see the 'averaged value of $f(nx)$', while $f(nx)$ can hardly detect the change of values of $g(x)$.) The above argument provides a quantitative version of this intuition.
A: With the substitution $v=nx$,  you get 
$$
\int_0^1 g(x)f(nx)\,dx=\frac1n\,\int_0^n g(v/n)\, f(v)\,dv=\frac1n\,\sum_{k=1}^n\int_{k-1}^k g(v/n)\,f(v)\,dv.
$$
Fix $\varepsilon>0$. Since $g$ is continuous on $[0,1]$, it is uniformly continuous by compactness, so there exists $\delta>0$ such that $|g(y)-g(x)|<\varepsilon$ whenever $|x-y|<\delta$. So, if $n>1/\delta$, then $$|g(v_1/n)-g(v_2/n)|<\varepsilon$$ for all $v_1,v_2\in[k,k+1]$. So
\begin{align}
\left|\int_0^1 g(x)f(nx)\,dx-\frac1n\,\sum_{k=1}^n\int_{k-1}^k g((k-1)/n)\,f(v)\,dv\right|<\varepsilon.
\end{align}
Now, since $f(x+1)=f(x)$, 
\begin{align}
\frac1n\,\sum_{k=1}^n\int_{k-1}^k g((k-1)/n)\,f(v)\,dv
&=\frac1n\,\sum_{k=1}^ng((k-1)/n)\int_{k-1}^k \,f(v)\,dv\\ \ \\
&=\frac1n\,\sum_{k=1}^ng((k-1)/n)\int_{0}^1 \,f(v)\,dv.
\end{align}
If we choose $n$ big enough, we can get $\frac1n\,\sum_{k=1}^ng((k-1)/n)$ arbitrarily close to $\int_0^1 g(x)\,dx$. That is, we may choose $n$ big enough so that 
$$
\left|\int_0^1 g(x)f(nx)\,dx-\int_0^1 g(x)\,dx\int_0^1 f(x)\,dx\right|<2\varepsilon.
$$
A: This is essentially the same answer as the others, except that it focuses on
the fact that a particular Riemann approximation converges to $\int g$ almost
everywhere (ae.) after which we can use the dominated convergence theorem.
If $g$ is Riemann integrable, then for ae. $t$, the function
$g_n(t) = {1 \over n} \sum_{k=0}^{n-1} g({t+k \over n})$ satisfies
$L(g,P_n) \le g_n(t) \le U(g,P_n)$, where $P_n$ is the partition
$(0,{1 \over n}, \cdots, {2 \over n}, \cdots, { n \over n})$.
Since $g$ is Riemann integrable, by choosing $n$ large enough, we see that $g_n(t) \to \int g$ for ae. $t$.
Since $\int_0^1 g(x) f(nx) dx = \int g_n(t) f(t) dt$, we can apply the dominated convergence theorem to get the desired result.
