If we remove the condition to be working modulo $p$ prime. Why does the theorem no longer hold? Would I be correct in thinking it is because in the induction we say $f(X)\equiv(X-a)g(X)$ so potentially if $f(X)\equiv0$ then one of the cases to consider is $X\equiv a \mod p$ which has at most one solution?. (I think maybe this is where it would break down if we worked modulo not a prime) But I can't see why explicitly it wouldn't work.
I didn't state the theorem of proof for the sake of brevity as I assume it is well known but if you need any clarification just ask.
Thanks!
Suppose that $p$ is prime and that $f(X)$ is a polynomial with integer coefficients and degree $d ≥ 0$. Then the equation $f(X) ≡ 0 \mod p$ has at most $d$ distinct solutions modulo $p$.