Problem $1$ from UCI's Fall 2015 Real Analysis Qualifying Exam asks us to calculate $$\lim_{n\to\infty}\int_E f(nx)dx$$ given that $f\in C(\mathbb R)$ is $1$-periodic and $E\subseteq [0,2\pi]$ is measurable.
According to the solutions website, the limit is $\mu(E)\int_0^1 f(x)dx$, where (I think) they meant to write the Lebesgue measure $m$ instead of $\mu$. Unfortunately, I don't see how one could guess that this is the correct limit, let alone prove it. The solution provided in the website defines $$h(x)=f(x)-\int_0^1 f(t)dt$$ and notes that $h$ is also $1$-periodic. It then writes $$\int_E f(nx)dx = \int_E\left(h(nx)+\int_0^1 f(t)dt\right)dx = \int_E h(nx)dx +\mu(E)\int_0^1 f(t)dt$$ and notes that it suffices to prove that $\lim_{n\to\infty}\int_E h(nx)dx=0$. The proof seems to make sense, but I have two questions:
How could one guess that the limit is $\mu(E)\int_0^1 f(x)dx$? The limit $\lim_{n\to\infty}\int_E f(nx)dx$ reminded me of a similar limit $\lim_{n\to\infty} \int_0^1 f(x)\sin(nx)dx$ occurring in James Stewart's Calculus: Early Transcendentals, which I correctly computed to be $0$. Given that the graph of $f(nx)$ is "squishing together" as $n\to\infty$, I thought the limit $\lim_{n\to\infty}\int_E f(nx)dx$ would also be $0$. This was until I noticed I could add $1$ to $f(nx)$ to get $1+f(nx)$, which is still $1$-periodic but gives $$\lim_{n\to\infty}\int_E (1+f(nx))dx=\mu(E)+\int_E f(nx)dx$$ which is more easily believed to be nonzero.
Where does $h$ come from? I'm not sure what thought process could lead someone to come up with $h$ and see its significance for the solution. Is there an intuitive way of thinking about what $h$ is doing here?
Any and all responses are greatly appreciated.