The arcsine function, $\arcsin : [-1,1] \to [-\frac \pi 2, \frac \pi 2]$ ($\color{red}{\mathit{note\ the \ codomain}}$ , and the function is often written as $\sin^{-1}$ but I prefer $\arcsin$) is defined as follows : if $a \in [-1,1]$ we can find a unique $x \in [-\frac \pi 2, \frac \pi 2]$ such that $\sin x =a$. We let $x = \arcsin a$.
Since there may be many $x$ such that $\sin x = a$, it is important to specify the codomain of the arcsine, so that we need not worry about multiple values.
Similarly, $\arctan : \mathbb R \to (-\frac \pi 2, \frac \pi 2)$ is defined as : for $a \in \mathbb R$ there is a unique $-\frac \pi 2 < x <\frac \pi 2$ with $\tan x =a$. We let $x = \arctan a$.
Now, we must prove the given statement. First of all, note that $-1\leq \frac{2x}{1+x^2} \leq 1$ for all values of $x$, so certainly $\arcsin \frac{2x}{1+x^2}$ is defined.
Now let $x \in \mathbb R$ and $\phi = \arctan x$ so that $x = \tan \phi$. Note that $-\frac \pi 2 < \phi < \frac \pi 2$. The argument you make shows that $$
\frac{2x}{1+x^2} = \sin 2 \phi
$$
and therefore, $$
\arcsin\left(\frac{2x}{1+x^2}\right) = \arcsin(\sin 2 \phi)
$$
Now, we would like to simplify the RHS. For this, we cannot simply cancel out the two functions, because of codomain issues. To be precise : $\arcsin(\sin 2 \phi) = \theta$ where $\theta$ is the unique angle in $[-\frac \pi 2, \frac \pi 2]$ such that $\sin 2 \phi = \sin \theta$. Therefore, $\arcsin(\frac{2x}{1+x^2}) = \theta$.
So we can break into cases :
If $2 \phi \in [-\frac \pi 2 , \frac \pi 2]$ then of course $\theta = 2 \phi$.
If $2\phi \in (\frac \pi 2 , \pi]$ then $\sin(\pi - x) = \sin x$ gives $\sin(\pi - 2\phi) = \sin 2 \phi$ so $\theta = \pi - 2\phi$ (which lies in the codomain).
If $2 \phi \in [-\pi , -\frac \pi 2)$ then $\sin(-\pi-x) = -\sin(\pi + x) = \sin x$ so $\sin(-\pi - 2\phi) = \sin(2 \phi)$, and hence $\theta = -\pi - 2 \phi$.
Finally, we know that $x>1, x<1,x \in [-1,1]$ if and only if $2 \phi > \frac \pi 2 , 2\phi < - \frac \pi 2, 2\phi \in [-\frac \pi 2, \frac \pi 2]$ respectively.
Therefore, we get :
If $-1 \leq x \leq 1$ then $\arcsin\left(\frac{2x}{1+x^2}\right) = 2 \phi$.
If $x>1$ then $\arcsin\left(\frac{2x}{1+x^2}\right) =\pi- 2 \phi$.
If $x<1$ then $\arcsin\left(\frac{2x}{1+x^2}\right) =-\pi- 2 \phi$
Bring $2\phi$ to one side in each of these equations, and you have your result.