If we want to find solutions of the equation $x^2=1$, where $x\in\mathbb{R}$, I frequently read/see that you should simply apply the inverse function which delivers $x=\pm1$.
I am not sure if I am overthinking but I would like to know if the following thoughts are correct if you want to derive the solutions rigorously:
1.) Applying the inverse function to solve for $x$ only makes sense if the function is injective (on the associated set). However, applying $\sqrt{\cdot}$ to $x^2=1$ yields $\sqrt{x^2}=|x|=1$ and I am not sure what this means. Is $|x|=1$ a well defined expression? I guess it's not?!
2.) If we only admit $x\geq0$, then $x^2$ becomes injective and $+\sqrt{\cdot}$ is the inverse function. Applying it to $x^2=1$ yields $\sqrt{x^2}=|x|=x=\sqrt{1}=1$.
3.) If we only admit $x<0$, then $x^2$ becomes injective and $-\sqrt{\cdot}$ is the inverse function. Applying it to $x^2=1$ yields $-\sqrt{x^2}=-|x|=-(-x)=-\sqrt{1}=-1$. Hence, $-1$ is a solution.
Is this the rigourous idea behind saying that the soultions are $\pm1$?
PS: Maybe in the context of this simple equation it seems kind of obvious but if we generalize it to some equation $h(x)=1$ where $h:\mathbb{R}\to\mathbb{R}$ and $h$ is only injective on say $[0,1]$, then applying $h^{-1}$ to $h(x)=1$ might produce an expression $h^{-1}\circ h$ which doesn't look as nice as $|x|$. One can think for example of the equation $\sin(x)=\frac{1}{2}$ where $x\in\mathbb{R}$. So you have no choice but to first restrict the domain and then apply the inverse function.
You are absolutely correct. In fact, when reading "applying the inverse function, we get $x=\pm1$" you should be confused by the fact that a function must return only one value, and in this case it would be returning two values ($1$ and $-1$).
Therefore, what is meant by that statement is, precisely, the whole procedure you just specified:
Another idea to take into account is that, in order to be sure to get all the possible values that make that condition true ($x^2=1$) restrictions should cover the entire domain.