Factorization of $z^4 +1 = (z^2 - \sqrt 2z+1)(z^2 + \sqrt 2 z+1)$ for complex $z$ How can I get this equation from LHS to RHS by using the four roots of $z^4 +1 = 0$ are $z=\pm\sqrt{\pm i}$
 $$z^4 +1 = (z^2 - \sqrt2 z+1)(z^2 + \sqrt2 z+1)$$

You don't need to know the roots of $P(z)=z^4+1$ for the factorization: $$z^4+1=z^4+2z^2+1-2z^2=(z^2+1)^2-(\sqrt{2}z)^2=(z^2-\sqrt{2}z+1)(z^2+\sqrt{2}z+1)$$

If you want to use that the roots of $P$ are $\omega=e^{i\frac{\pi}{4}}$, $i\omega$, $-\omega$ and $-i\omega$ (I tend to avoid to use the notation $\sqrt{z}$ for numbers that are not nonnegative real numbers), note that you have two pairs of conjugated complex numbers (namely $\omega$ and $-i\omega$, and $i\omega$ and $-\omega$) that will combine into a polynomial of degree $2$ with real coefficients. By combine, I mean $(z-a)(z-\overline{a})$ is a polynomial with real coefficients.
