TITLE: Polynomials irreducible over $\mathbb{Q}$ but reducible over $\mathbb{F}_p$ for every prime $p$
QUESTION [76 upvotes]: Let $f(x) \in \mathbb{Z}[x]$. If we reduce the coefficents of $f(x)$ modulo $p$, where $p$ is prime, we get a polynomial $f^*(x) \in \mathbb{F}_p[x]$. Then if $f^*(x)$ is irreducible and has the same degree as $f(x)$, the polynomial $f(x)$ is irreducible. 
This is one way to show that a polynomial in $\mathbb{Z}[x]$ is irreducible, but it does not always work. There are polynomials which are irreducible in $\mathbb{Z}[x]$ yet factor in $\mathbb{F}_p[x]$ for every prime $p$. The only examples I know are $x^4 + 1$ and $x^4 - 10x^2 + 1$.
I'd like to see more examples, in particular an infinite family of polynomials like this would be interesting. How does one go about finding them? Has anyone ever attempted classifying all polynomials in $\mathbb{Z}[x]$ with this property?

REPLY [16 votes]: For any distinct primes $p_1,p_2$ the polynomial
$$x^4-2(p_1+p_2)x^2+(p_1-p_2)^2,(1)$$
is irreducible in $\Bbb Q$, but this polynomial is reducible modulo $p$ for any prime $p$. Let us see why:
It is a well-known fact that $[\Bbb Q(\sqrt{p_1},\sqrt{p_2}):\Bbb Q]=4$ and $\Bbb Q(\sqrt{p_1}+\sqrt{p_2})=\Bbb Q(\sqrt{p_1},\sqrt{p_2})$; see this, thus as $\sqrt{p_1}+\sqrt{p_2}$ is a root of $(1)$, this polynomial is irreducible over $\Bbb Q$.
As the Legendre symbol is multiplicative we get that $p_1$ or $p_2$ have a square root modulo $p$ or $p_1p_2$ does; notice this happens trivially if $p=p_1$ or $p=p_2$, hence as $\Bbb F_p(\sqrt{p_1},\sqrt{p_2})=\Bbb F_p(\sqrt{p_1},\sqrt{p_1p_2})=\Bbb F_p(\sqrt{p_2},\sqrt{p_1p_2})$, we obtain
$$[\Bbb F_p(\sqrt{p_1},\sqrt{p_2}):\Bbb F_p]\leq 2,$$
and this implies $(1)$ is not irreducible as $\sqrt{p_1}+\sqrt{p_2}$ is a root.
The polynomial $x^4-10x^2+1$ is a particular case with $p_1=2$ and $p_2=3$.