Let $f_p(t)$ be a periodic function with period $T$.An identity that we often use is that$$\int_{-\infty}^{\infty} dt \, f_p(t) \left[ g(t) - g(t - T) \right]=0\, ,$$which can be shown by shifting the argument by $T$.
However, I am confused about the sufficient and necessary conditions for the equality above to hold.
As a counterexample, suppose that$$g(t) - g(t - T) = \Theta(t)\, ,$$where $\Theta(t)$ is the Heaviside step function.The form of $g(t)$ can be solved iteratively to give for example the particular solution$$g(t) = \sum_{n = 0}^{\infty} \Theta(t - n T)\, .$$But in this case, we would instead end up with
$$\int_{-\infty}^{\infty} dt \, f_p(t) \left[ g(t) - g(t - T) \right]=\int_0^{\infty} f_p(t) \, dt\neq 0\, ,$$which is inconsistent with the identity written above.
I feel like I am missing something very elementary here, but couldn't figure it out. Does continuity of $g(t)$ play a role here? Hope someone here can lend a helping hand. Thanks a lot in advance!