Factoring

x^2+1=
(x+1)(x+1)= 5
Trying to see if I am doing it right or have the right answer.

you cannot factor x^2+1

plug in some numbers and you will see quickly that

(x+1)(x+1) ≠ x^2+1

If you allow complex numbers, then

x^2+1 = (x+i)(x-i)