I have one question:
Let's say that in $\Bbb Q[x]$ the element $(x^2 - 2)$ by the mod $p$ test, for $p= 2$ reduces to $x^2$ which is reducible over $\Bbb Q[x]$. But we know from factorization of $(x^2 - 2)$ can be expressed as $(x - \sqrt2)(x +\sqrt2)$ which has irrational roots and hence $x^2 - 2$ is irreducible.
Does the mod $p$ test fail here, or am I missing something?