If $f$ is a periodic function with $T = \pi$, does that mean that $F$ (a primitive of $f$) has the same period ? What about the inverse implication (periodic primitive implies periodic function) ?
If $F(x)=F(x+\pi)$, it follows immediately by the chain rule that $F'(x)=F'(x+\pi)$. So if $F'=f$ has a periodic primitive, it is periodic.
The converse is false. The function $f(x)=\cos x + 1$ is periodic, but its primitives are of the form $F(x)=\sin x + x + C$, which are not. If you want $f$ to have periodic primitive, you need the additional condition that it integrates to $0$ over an entire period.