Domain of $\sqrt{x}$ function when solving $x^2 - 2=0$ I've been going through this solution and got stuck on explaining myself why  $x^2 = 2 \Rightarrow \sqrt{x^2} =  \sqrt{2}\Rightarrow x = \pm \sqrt2$.  Domain of $f(x)=\sqrt{x}$ is $[0,\infty)$. How taking square root both sides give $\pm \sqrt{2}$ ?


There are two distinct concepts at play here. $\sqrt{x}$ is a function denoting the nonnegative square root of $x$. However, the general solution to $a^2 = b^2$ is $a = \pm b$. So $\sqrt{25}=5$, but if $x^2=25$ then $x=\pm5$. As Gae. S. has already mentioned, the easiest way to see that $a^2=b^2 \iff a= \pm b$ is through factorisation:
\begin{align}
&a^2=b^2 \\
\iff&a^2-b^2=0 \\
\iff&(a+b)(a-b)=0 \\
\iff&a=-b \text{ or } a=b \, .
\end{align}
So, in your example, we have $x^2=(\sqrt{2})^2 \iff x=\pm\sqrt{2}$.
