Problem: If $ f \in \mathbb{Z}[X] $ and $ f(a) ≡ 0 \pmod n $ for some $ a \in \mathbb{Z} $, then there exists a $ g \in \mathbb{Z}[X] $ such that $ f(X) ≡ (X − a) g(X) \pmod n $.
I think that this is related to Lagrange’s Theorem and that we would need to use the fact that $$ X^{n} - a^{n} = (X - a) (X^{n - 1} + X^{n - 2} a + \cdots + X a^{n - 2} + a^{n - 1}), $$ but I’m not sure how to put it all together. Can anyone offer help on a proof? Thanks!
One way is to note that by "polynomial division" there is a polynomial $g(x)$ with integer coefficients, and a constant $c$, such that $$f(x)=(x-a)g(x)+c.$$ Then if $f(a)\equiv 0\pmod{n}$, we get by substitution that $c\equiv 0\pmod{n}$.