Denote by $p_k$ the $k$-th prime. Fix an integer $r\geq 1$. Let $P=p_1p_2p_3 \ldots p_r$ and $g(x)=f(\frac{x}{P})$. Then
$g$ satisfies :
$$
\sum_{j=0}^{p_k-1} g\left(y+j\prod_{l\neq k}p_l\right)=0 \tag{1}
$$
for any $k\in [1,r]$ and $y\in{\mathbb R}$. For $P\in{\mathbb Q}[X]$, $P=\sum_{k=0}^d a_kX^k$, define
$$
\psi(P)=\sum_{k=0}^d a_k g(y+k) \tag{2}
$$
Then $\psi$ is a ring homomorphism, and (1) tell us that the polynomial
$Q_k=\sum_{j=0}^{p_k-1} X^{j\prod_{l\neq k}p_l}$ is in ${\sf Ker}(\psi)$. Now
$Q_k=\Phi_{p_k}(X^{\prod_{l\neq k}p_l})$, so that $z\in{\mathbb C}$ is a root of
$Q_k$ iff $z^{\frac{P}{p_k}}$ is a primtive $p_k$-th root of unity.
It follows that $z$ is a common root of all the $Q_k (1\leq k \leq r)$ iff $z$ is a primitive
$P$-th root of unity. The gcd of the $Q_k (1\leq k \leq r)$ is therefore
$\Phi_{P}$. But since ${\sf Ker}(\psi)$ is an ideal of $P\in{\mathbb Q}[X]$, we have
$\Phi_P \in {\sf Ker}(\psi)$. We know that the degree of $\Phi_P$ is exactly
$\phi(P)=\prod_{k=1}^r (p_k-1)=d_k$, so we can write $\phi_P=X^{d_k}+
\sum_{i=0}^{d_k-1} a_i X^i$
where the $a_i$ are integers. We then have :
$$
g(y+d_k)=\sum_{i=0}^{d_k-1}a_ig(y+i) \tag{3}
$$
for any $y\in{\mathbb R}$. Iterating (3), we see that if $g$ is zero on an
interval of length $\geq d_k$ then it must be zero everywhere.
We deduce that if $f$ iz zero on an interval of length $\geq \frac{d_k}{P}=e_k$
then it must be zero everywhere. But
$$
e_k=\prod_{k=1}^r \left(1-\frac{1}{p_k}\right) \tag{4}
$$
tends to zero when $r\to\infty$ (by
Euler’s product formula for example), so we are done.