Every continuous integrable function satisfying your hypothesis is a linear combination of $\sin(2\pi x)$ and $\cos (2\pi x)$. The key fact is that if $f:\mathbb{R}/\mathbb{Z}\rightarrow \mathbb{C}$ is continuous and integrable then it is uniquely determined by its Fourier coefficients. If the Fourier series expansion of $f$ is $$f(x)=\sum_{n\in\mathbb{Z}}c(n)e(nx),$$ where $e(x)=\exp (2\pi i x)$, then for $n>1$ the Fourier expansion of $$g_n(x):=\sum_{a=1}^nf\left(x+\frac{a}{n}\right)$$ is $$g_n(x)=\sum_{m\in\mathbb{Z}}c(m)\left(\sum_{a=1}^ne(ma/n)\right)e(mx)$$ $$=n\sum_{m\in\mathbb{Z}}c(mn)e(mnx).$$ If $g_n(x)=0$ for all $n>1$ and for all $x$ then we must have that $c(mn)=0$ for all $m\in\mathbb{Z}$ and for all $n>1$, and this proves the result.