$x^4+6x^2+1$ is reducible modulo $p$ for every prime $p$. Let $f(x)=x^4+6x^2+1 \in \mathbb{Z}[X]$. We have to prove that $f$ is reducible modulo $p$ for all prime $p$.
I am not sure how to proceed. Please give me some hints so that I can try solving the problem.

Edit I:
I have tried with the following primes.

*

*For p=2; $f(x)$ reduces to $x^4+1 = (x^2+1)^2$ since $\bar{6}=\bar{0}=\bar{2}$. Hence $f(x)$ is reducible mod 2.


*For p=3; $f(x)$ also reduces to $x^4+1=(x^2+x+2)(x^2+2x+2)$ in $\mathbb{Z}_3[X]$

Edit II: Following JyrkiLahtonen's comment I am adding a few more things:
A. Taking $y=x^2;\ f(x)$ becomes $y^2-6y+1$. Solving the equation $y^2-6y+1=0$ we get
$$
y=-3 \pm 2 \sqrt{2}
$$
Now replacing $y$ by $x^2$ we get the following
$$
x=\pm\sqrt{-3+2\sqrt{2}}=\pm(i-i\sqrt{2}) \ \ \ \text{and} \ \ \ x=\pm\sqrt{-3-2\sqrt{2}}=\pm(i+i\sqrt{2})
$$
Hence we have obtained all the roots of the polynomial $f(x)$; say $x_1,x_2,x_3,x_4$.
B. The three ways of expanding this quartic are as follows:

*

*$\{(x-x_1)(x-x_2)\}\{(x-x_3)(x-x_4)\}=(x^2+1-2ix)(x^2+1+2ix)\\
= (x^2+1)^2-(2ix)^2 \\
= (x^2+1)^2-2^2(-1)x^2$


*$\{(x-x_1)(x-x_4)\}\{(x-x_2)(x-x_3)\}=(x^2-1-2\sqrt{2}ix)(x^2-1+2\sqrt{2}ix)\\
= (x^2-1)^2-(2\sqrt{2}ix)^2\\
=(x^2-1)^2-2^2(-2)x^2$


*$\{(x-x_1)(x-x_3)\}\{(x-x_2)(x-x_4)\}=(x^2+3+2\sqrt{2})(x^2+3-2\sqrt{2})\\
=(x^2+3)^2-(2\sqrt{2})^2\\
=(x^2+3)^2-2^2(2)$
C. Now the final piece.
$f(x)$ can be factored in any of the above 3 ways. Consider any prime $p$.

*

*If -1 is square element in $\mathbb{F}_p$; there exist $a \in \mathbb{F}_p$ such that $-1=a^2$. So factoring $f(x)$ as in form B.1. Hence considering $f(x)$ in $\mathbb{F}_p[X]$ we have
$$
f(x)=(x^2+1)^2-2^2(-1)x^2=(x^2+1)^2-(2ax)^2=(x^2+1-2ax)(x^2+1+2ax) 
$$
Hence $f(x)$ is reducible modulo $p$ if $-1$ is a square element.


*If 2 is square element in $\mathbb{F}_p$, where $p$ is an odd prime; there exist $a \in \mathbb{F}_p$ such that $2=a^2$. So we factor $f(x)$ as in form B.3. Now considering $f(x)$ in $\mathbb{F}_p[X]$ we have
$$
f(x) =(x^2+3)^2-2^2(2)=(x^2+3)^2-(2a)^2=(x^2+3+2a)(x^2+3-2a)
$$
Hence we get $f(x)$ is reducible modulo $p$ if $2$ is a square element.


*Now if both $-1$ and $2$ are non square elements in $\mathbb{F}_p$ then $-2$ is a square element in $\mathbb{F}_p$ (follows by using Legendre symbol as mentioned in the comment by Jyrki Lahtonen.) Hence factoring $f(x)$ as in the form B.2 we get that $f(x)$ is reducible modulo $p$.
Hence we have $f(x)$ is reducible modulo $p$ for all $p$.

This is a special case of a more general infinite class of polynomials with similar property. I have written the general case here.
 A: Here is a bit of a different approach.
For $p=2$, we can factor
$$
\begin{align}
x^4+6x^2+1
&\equiv(x-1)^4&\pmod2
\end{align}
$$
For the odd primes, where $p\in\{1,3,5,7\}\pmod8$, we will use the results from this answer, to show that $-1$ is a quadratic residue mod $p$ iff $p\equiv1\pmod4$, and this answer, to show that $2$ is a quadratic residue mod $p$ iff $p\equiv\pm1\pmod8$. Together, those answers show that $-2$ is a quadratic residue mod $p$ iff $p\equiv1,3\pmod8$.
Since $p\equiv1,5\pmod8$ implies there is a $q$ so that $q^2\equiv-1\pmod p$, we can factor
$$
\begin{align}
x^4+6x^2+1
&=\left(x^2+1\right)^2-(-4)x^2\\
&\equiv\left(x^2-2qx+1\right)(x^2+2qx+1)&\pmod p\\
\end{align}
$$
Since $p\equiv1,3\pmod8$ implies there is a $q$ so that $q^2\equiv-2\pmod p$, we can factor
$$
\begin{align}
x^4+6x^2+1
&=\left(x^2-1\right)^2-(-8)x^2\\
&\equiv\left(x^2-2qx-1\right)(x^2+2qx-1)&\pmod p\\
\end{align}
$$
Since $p\equiv1,7\pmod8$ implies there is a $q$ so that $q^2\equiv2\pmod p$, we can factor
$$
\begin{align}
x^4+6x^2+1
&=\left(x^2+3\right)^2-8\\
&\equiv\left(x^2+3-2q\right)(x^2+3+2q)&\pmod p\\
\end{align}
$$
