TITLE: Finding the value of k in the following limit
QUESTION [6 upvotes]: Let $f :\mathbb{R}\to \mathbb{R}$ be a continuous function with period $1$ and
  $$\lim_{n\to\infty}\int_0^1\sin^2(\pi x)f(nx)dx= \frac{1}{k}\int_0^1f(x)dx.$$
  Find $k$.

My approach till now: 
Applying half angle formula $2\sin^2(x) = 1-\cos(2x)$ I got :
$$\frac{1}{2}\int_0^1f(nx)dx-
\frac{1}{2}\int_0^1\cos(2\pi x)f(nx)dx.$$
I can't think of a way forward from here without applying integration by parts but i don't know if its right to apply it as we don't know about the differentiability of the function $f$.
Please help me with this problem.

REPLY [2 votes]: Let $g:[0,1]\to\mathbb{R}$ be a continuous function. Then
\begin{aligned}\int_0^1 g(x)f(nx)dx&=\frac{1}{n}\int_0^n g\left(\frac{t}{n}\right)f(t)dt\\
&=\frac{1}{n}\sum_{k=0}^{n-1}\int_0^1 g\left(\frac{t+k}{n}\right)f(t)dt\\
&=\frac{1}{n}\sum_{k=0}^{n-1} g(t_k)\int_0^1 f(t)dt
\end{aligned}
where we used the $1$-periodicity of $f$ and the fact that by the Mean Value Theorem $\exists t_k\in [k,k+1]$ such that
$$\int_0^1 g\left(\frac{t+k}{n}\right)f(t)dt=g(t_k)\int_0^1 f(t)dt.$$
Therefore
$$\lim_{n\to\infty}\int_0^1 g(x)f(nx)dt=\int_0^1g(t)dt\cdot \int_0^1f(t)dt.$$
Hence, from your work, it follows that as $n\to\infty$,
$$\int_0^1\sin^2(\pi x)f(nx)dx=\frac{1}{2}\int_0^1f(nx)dx-
\frac{1}{2}\int_0^1\cos(2\pi x)f(nx)dx\to \frac{1}{2}\int_0^1f(x)dx$$
which means that $k=2$.