According to this calculator:
The possible values for $x$ when $x^2+1=0$ are $i$ and $-i$.
If $$x^2+1=0$$, then why are the possible answers both $i$ and $-i$?
Original equation: $$x^2+1=0$$
subtract $1$ from both side: $$x^2=-1$$
Take the square root of both sides: $$\sqrt{x^2} = \sqrt{-1}$$
Simplify only the left side: $$x=\sqrt{-1}$$
Since $i$ is equal to $\sqrt{-1}$, I replace $\sqrt{-1}$ with $i$: $$x=i$$
Where does the $x=-i$ come from?
$x^2-a^2 = (x+a)(x-a)$, so the solutions are $x=a$ and $x=-a$. In other words, the solutions are $x=\pm\sqrt{a^2}$.