For $f$ periodic, $g\to 0$ the integral of $fg$ converges (under some more conditions) Let $f,g:\mathbb{R}\to\mathbb{R}$ be continuous functions such that:


*

*$f$ is periodic, with finitely many zeros in a period

*The average value of $f$ on a period is $0$

*$g$ is monotonic decreasing and $\lim_{x\to\infty}g(x)=0$


Prove that $$\int_c^{\infty}f(x)g(x)\, dx<\infty$$ for any finite $c$, where the integral is taken in the Reimann sense (in particular, it need only be conditionally convergent).
Note: Can the "finite zeros" requirement be dispensed with or replaced by something weaker? Is it really necessary for $g$ to be continuous?
 A: [Original version] can't be quite right, because we could take one function to be $\sin x$ and the other to be $1/x$ where $\sin x>0$ and $1/x^2$ where $\sin x<0$.
Edit: with suitable adjustments to the hypotheses, one true version I could imagine would be a continuous analogue of the generalized "alternating decreasing" convergence: given $a_n$ positive and monotone decreasing to $0$, and given $b_n$ with partial sums $b_1+\ldots b_n$ bounded, summation by parts shows $\sum a_n b_n$ converges.
A: This is the skeleton of the proof I had in mind.
Assume $f\not\equiv 0$. Let $\tau$ be the minimal period of $f$. Partition $\mathbb{R}\mod\tau\mathbb{Z}$ by the points $t_i$, which are the zeros of $f$ at which $f$ changes sign. Since $f$ has a finite number of zeros in a period, there are also a finite number of sign-changing zeros. Explicitly, the domain is partitioned into $$\bigcup\left([t_i,t_{i+1})+\tau\mathbb{Z}\right)$$
So $f$ alternates sign on these intervals. Form an upper bound for the integral by estimating the contribution from positive regions as $$g(t_i)\int_{t_i}^{t_{i+1}}f(x)\,dx$$ and the contribution from negative regions as $$g(t_{i+1})\int_{t_i}^{t_{i+1}}f(x)\,dx$$
Now that things have been approximated by step functions, we are back to the discrete case and arguments like those in paul's edit should apply.
