$L^p$ convergence of certain "average" function Given a function $f \in L^2([0,1])$. Let's fix some irrational number $\omega$. For any $N \in \mathbb{Z}^{+}$, let's define a function $g_{N}$ as follows:
$$g_{N}(x) := \frac{1}{N}\sum_{j=1}^{N}f(x+j\omega)-\int_{0}^{1}f(y)dy$$
Prove that $\lim_{N \rightarrow \infty}||g_{N}||_{L^2(\mathbb{T})} = 0$. Moreover, if we further assume $f$ is periodic with period $\omega$, then $f$ must be constant.
I'm interested in how the first claim can be proved. How does the "irrational number" assumption come into play here? Any hint/discussion would be appreciated!
 A: Welcome to MSE!
This is part of a subject called ergodic theory. In particular, let's think about a the "rotate by $\omega$" transformation $T_\omega : \mathbb{T} \to \mathbb{T}$. Then we want to consider the function
$$
A_N(x) = \frac{1}{N} \sum_{j \leq N} f \circ T_\omega^j(x)
$$
Here $A_N(x)$ is the "time average" of $f$. If you imagine every second we apply $T_\omega$, then $A_N(x)$ is the average value that our function takes over the first $N$ seconds if we start at $x$.
We can also consider the "space average" of $f$, which is the average value of $f$ over the circle $\mathbb{T}$ (with respect to lebesgue measure):
$$\int_\mathbb{T} f$$
There is a deep and beautiful theorem (due to von Neumann) which says that if $T_\omega$ "does a good job mixing $\mathbb{T}$" (in the sense that the only sets fixed by $T_\omega$ are null or conull) then actually the time average $A_N$ converges to the space average in the $L^2$ sense. That is
$$
\left \lVert A_N(x) - \int_\mathbb{T} f \right \rVert_2 \to 0.
$$
Intuitively, this should make some amount of sense. If $T_\omega$ is doing a good job mixing our space around, then over large timescales we expect to see the entire space, no matter where we start. Then we're sampling points from all over, and our average should converge to the "true" average.
This gives an intuitive reason for why we need $\omega$ to be irrational. If you move by some rational amount, then you aren't really mixing the points of $\mathbb{T}$ around. Each point actually stays in some fixed orbit of finite length. Formally, we say that $T_{a/b}$ is not ergodic with respect to the lebesgue measure, while $T_{\omega}$ for irrational $\omega$ is ergodic.
The proof of von Neumann's ergodic theorem is a bit long for an mse answer, but you can find a slick proof here, or by googling around (now that you have a name to google!)

I hope this helps ^_^
