I can think of an example where this wouldn't hold.
But I can also prove that the statement holds.
Claim: $|f|$ is periodic then $f$ is periodic
$f(x+p)=\pm f(x)$ if $f(x+p)=+f(x)$ then we are done, if $f(x+p)=-f(x)$ we get:
$f(x+2p)=-f(x+p)=f(x)$, so the period is twice bigger, but It still holds that $f$ is periodic.
Where is my mistake?