Clearly $f$ is not identically null. Let $f(x) = x^mg(x)$ for some $g\in \mathbb{Z}[x]$ with $g(0)\neq 0$ and $m\in \mathbb{Z}_+$. If $\deg g = 0$, then $f(x)=ax^m$, and it is easy to see we need $a=\pm 1$, but we can take arbitrary $m$.
If $\deg g > 0$, it is widely known there are infinitely many primes dividing the different values of $g(n)$, $n\in \mathbb{N}$. Let $r$ be such a prime, dividing some $g(n)$, and so that $\gcd(r,g(0))=1$. Then obviously $\gcd(r,n)=1$. But $g(n+kr) \equiv g(n) \pmod{r}$ for any $k\in \mathbb{N}$, and this arithmetic progression $\{n+kr \mid k=0,1,2,\ldots\}$ contains infinitely many primes, by Dirichlet's theorem. Take $p$ and $q$ two of these primes, to get $g(p) \equiv g(q) \pmod{r}$. Thus we cannot have $\deg g > 0$.