Q:

Irreducible polynomial is square-free modulo almost every prime

Let $f \in \Bbb Z[X]$ be irreducible. What is the easiest way to show that there are only finitely many primes $p$ such that $f \pmod p$ is not square-free (i.e. not separable) in $\Bbb F_p[X]$ ?
Is it necessary to use the fact that a prime $p$ is ramified in a number field iff $p$ divides the discriminant (hence there are finitely many such primes)?
Thank you?

A:

Since $f$ is irreducible in $\mathbb{Z}[x]$, it's irreducible in $\mathbb{Q}[x]$, so in $\mathbb{Q}[x]$, we have $\gcd(f,f')=1$.

It follows that $af+bf'=1$, for some $a,b\in\mathbb{Q}[x]$.

Clearing denominators, we get $Af+Bf'=n$, for some $A,B\in\mathbb{Z}[x]$, and some positive integer $n$.

Suppose $p$ is a prime which not a prime factor of $n$.

Then $n$ is a unit, mod $p$, hence from the equation $Af+Bf'=n$, we get that $f$ and $f'$ have no non-unit common factor, mod $p$.

It follows that $f$ is squarefree, mod $p$.

