TITLE: Relationship between divisibility of polynomials and divisibility of its evaluations
QUESTION [6 upvotes]: Let $f$ and $g$ be primitive polynomials over $\mathbb{Z}$. Decide if the following is true:
$f(x) \mid g(x)$ for infinitely many $x\in\mathbb Z$ implies $f\mid g$ as polynomials in $\mathbb{Z}[x]$.

Two comments:

for $f = 2$ and $g = x+1$, we have $f\nmid g$, but $f(x) \mid g(x)$ for infinitely many $x\in\mathbb{Z}$. For that reason, I've added the requirement "primitive". I hope that I didn't miss any further trivial condition one should impose on $f$ and $g$.

If we replace divisibility by equality, $f(x) = g(x)$ for sufficiently many $x\in\mathbb Z$ implies $f = g$. Namely, it suffices to have $f(x) = g(x)$ for at least $\max(\operatorname{deg}(f),\operatorname{deg}(g))$ values $x\in\mathbb{Z}$.
However, for $f = x$ and $g$ a polynomial with constant coefficient $a\neq 0$, we have that $f(d) \mid g(d)$ for all divisors of $a$, but $f\nmid g$ (see the comment of André Nicolas). So no finite bound on the number of $x\in\mathbb Z$ with $f(x) = g(x)$ depending only on $\deg(f)$ and $\deg(g)$ will imply $f \mid g$.

REPLY [3 votes]: Write the rational fraction $g(x)/f(x)$ as $q(x) + r(x)$ where $q \in \Bbb Q[X]$ and $r \in \Bbb Q(x)$ with $r(\infty) = 0$. Let $d$ be the least common denominator for the coefficients in $q$. Then for $x \in \Bbb Z$, $q(x) \in \frac 1d \Bbb Z$. When $|x|$ is large enough, we can make $|r(x)| < 1/d$, and so $g(x)/f(x)$ can only be an integer if $r(x)=0$ and $q(x)$ itself is that integer.
If $g(x)/f(x)$ is an integer for infinately many integers $x$, this implies that $r(x)=0$ for infinitely many integers, and so $r = 0$, and $f(x) = q(x)g(x)$.
Multiplying this by $d$ we obtain $df = (dq)g$ where $dq$ and $g$ are primitive polynomials over the integers. Hence by Gauss' lemma, $df$ is also primitive, which shows that $d=1$, and $f=qg$ with $q \in \Bbb Z[X]$