<s>[INST] How to factorize $x^4+2x^2+4$ to a product of polynomials with real coefficients? How do you factor 
$$x^4+2x^2+4 $$ 
so it can be written as
$$ (x^2+2x+2)(x^2-2x+2) $$
 [/INST] Certainly the solution using completing the square (already provided in two answers) is in this case the easiest one.
I will just point out that in general if you have a real polynomial which is simple enough so that we are able to find all complex roots, this might also help you find factorization over $\mathbb R$. This works because for every root $z=a+bi$ also the complex conjugate $\overline z=a-bi$ is a root. And these pairs give you quadratic factors
$$(x-z)(x-\overline z)=(x-a-bi)(x-a+bi)=x^2-2a+b^2+b^2.$$
See also: Complex conjugate root theorem

In this case you can use substitution $t=x^2$ to get a quadratic equation 
$$t^2+2t+4=0$$
which has the solutions $t_{1,2}=\frac{-2\pm\sqrt{12}i}2=-1\pm\sqrt3i = 2\left(-\frac12\pm\frac{\sqrt3}2i\right)$.
Now you can solve the equations
$$x^2=-1\pm\sqrt3i$$
which have the solutions
\begin{align*}
x_1&=\sqrt2\left(\frac12+\frac{\sqrt3}2i\right)\\
x_2&=\sqrt2\left(-\frac12\pm\frac{\sqrt3}2i\right)\\
x_3&=\overline{x_1}\\
x_4&=\overline{x_2}
\end{align*}
This will give you the following quadratic factors:
\begin{align*}
(x-x_1)(x-\overline{x_1}) = x^2-\sqrt2x+2\\
(x-x_2)(x-\overline{x_2}) = x^2+\sqrt2x+2
\end{align*}
</s>