On Vanishing Riemann Sums and Odd Functions

Take the function $f(x)=\sum_{j\geq1} \alpha_j \cos(\pi j x)$. Then its $n$-th midpoint Riemann sum is $$\begin{align} 0 = R_n f &= \sum_{j\geq1}\alpha_j \sum_{1\leq k\leq n}\frac{2}{n} \cos\left( \pi j\left( -1 + \frac{2k-1}{n}\right)\right) \\&= \frac{2}{n}\sum_{j\geq1}\alpha_j \sum_{1\leq k\leq n} (-1)^j\cos\left(\pi j(2k-1)/n\right) \\&= \frac{2}{n} \sum_{j\geq1} \alpha_j \frac{\sin \pi j}{\sin (\pi j/n)} \end{align}$$ where (by Mathematica) $$ \sum_{1\leq k\leq n}\cos\frac{\pi j(2k-1)}{n} = \frac{\cos \pi j\sin \pi j}{\sin (\pi j/n)}$$ and when I write $\sin \pi j/\sin(\pi j/n)$ I mean the limit as $j$ approaches its integer value (so no division by zero).

Now, when $n=1$, the condition is $$ 0 = \sum_{j\geq1} \alpha_j $$ and when $n>1$, the condition is $$ 0 = \sum_{j\geq1} \alpha_j(-1)^{(j/n)}[n\backslash j]. $$

The condition $R_n f=0$ is only nontrivial when there are $j$ such that $n\backslash j$ and $\alpha_j\neq0$. So suppose that $\alpha_j\neq0$ only when $j$ is a power of 2, so that the function is $$ f(x) = \sum_{k\geq0} \beta_k \cos(\pi 2^k x). $$ Then the only $n$ that impose any conditions on $\alpha_k$ are the powers of 2.

If $n=2^m$, $m>0$, then the condition is $$ \beta_m - \beta_{m+1}-\beta_{m+2}-\cdots = 0, $$ and for $n=1$ the condition is $$ \sum_{k\geq0} \beta_k = 0. $$

Pick $\beta_0 = -1, \beta_k = 2^{-k}$ ($k\geq1$). The condition for each $n=2^m$ and also $n=1$ will be satisfied, the function $$ f(x) = -\cos\pi x+\sum_{k\geq1} 2^{-k} \cos(\pi 2^k x) $$ is clearly even and nonzero, and $R_nf=0$ for every $n$.

If the Fourier series is finite, the function must then be zero.