# Weird Riemann sum

Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be a continuous periodic function of period $1$ and $a$ be an irrational number. My goal is to prove

$$\lim_{N\rightarrow +\infty}\frac{1}{N}\sum_{n=1}^Nf(na)=\int_0^1f(t)\,dt.$$

I have first defined $x_n=na-[na]$, where $[\cdot]$ is the floor function, and I have proved that $\{x_n\}_{n\geq 1}$ is dense in $[0,1]$.

My goal was then to create partitions of $[0,1]$ by $0<y_1<\ldots <y_N<1$, where $(y_n)_{n=1}^N$ is the ordering of $(x_n)_{n=1}^N$, and to use a Riemann sum. I thought this would give the result but what I actually get is

$$\lim_{N\rightarrow +\infty}\sum_{n=1}^{N-1}(y_{n+1}-y_n)f(na)=\int_0^1f(t)\,dt.$$ Can this expression be linked with the limit I am interested in or should I do a different reasoning?

Hint: Given $f:[0,1]\to R$ continuous and $f(0)=f(1)$, it is known there exists $f_\epsilon:[0,1] \to R$ of the form $f_\epsilon(x) = \sum_{k=-m}^m a_k e^{2\pi kx}$ such that $\sup_{x \in [0,1]} |f(x)-f_\epsilon(x)|<\epsilon$ for ($\epsilon > 0$, of course). Show that the limit you are trying to prove is true for all trig polynomials first and then use the fact just given to prove it in general.