FullSimplify[ComplexExpand[ArcSin[(2 x)/(1 + x^2)], TargetFunctions->{Re, Im}], x ∈ Reals]
Integrate[% /. Abs -> RealAbs, x]
% // Simplify
Resolve[ForAll[x, Evaluate[ArcSin[(2 x)/(1 + x^2)] == D[%, x]]], Reals]
ArcTan[Abs[-1 + x^2], 2 x]
$\begin{array}{cc}
\{ &
\begin{array}{cc}
x \tan ^{-1}\left(x^2-1,2 x\right)+\log \left(x^2+1\right) & x\leq -1 \\
x \tan ^{-1}\left(1-x^2,2 x\right)-\log \left(x^2+1\right)+2 \log (2) & -1<x\leq 1 \\
x \tan ^{-1}\left(x^2-1,2 x\right)+\log \left(x^2+1\right) & \text{True} \\
\end{array}
\\
\end{array}$
$\begin{array}{cc}
\{ &
\begin{array}{cc}
x \tan ^{-1}\left(1-x^2,2 x\right)-\log \left(x^2+1\right)+\log (4) & -1<x\leq 1 \\
x \tan ^{-1}\left(x^2-1,2 x\right)+\log \left(x^2+1\right) & \text{True} \\
\end{array}
\\
\end{array}$
True
Another way:
$$\sin^{-1}\frac{2x}{1+x^2}=\begin{cases}2\tan^{-1}x&\text{ if }|x|\leq{1}\\\pi-2\tan^{-1}x&\text{ if }|x|>{1}&\text{ and }x>0\\-\pi-2\tan^{-1}x&\text{ if }|x|>{1}&\text{ and }x<0\end{cases}=\begin{cases}2\tan^{-1}x&\text{ if }|x|\leq{1}\\2 \tan ^{-1}\left(\frac{1}{x}\right)&\text{ if }x > 1&\text{or } x < -1\end{cases}$$
This can be verified with Mathematica
FullSimplify[π - 2 ArcTan[x] == 2 ArcTan[1/x], {Abs[x] > 1, x > 0}]
FullSimplify[-π - 2 ArcTan[x] == 2 ArcTan[1/x], {Abs[x] > 1, x < 0}]
Reduce[(Abs[x] > 1 && x > 0) || (Abs[x] > 1 && x < 0), x, Reals]
True
True
x < -1 || x > 1
expr = ArcSin[(2 x)/(1 + x^2)];
sol = Solve[Reduce[{y == expr}, x, Reals] // Simplify, y, Reals(*,MaxExtraConditions -> All*)]
pw = y /. sol /. ConditionalExpression -> List // Piecewise
int = Integrate[pw, x] // Simplify
Resolve[ForAll[x, Evaluate[expr == D[int, x]]], Reals]
{{y -> ConditionalExpression[2 ArcTan[1/x], x > 1 || x < -1]},
{y -> ConditionalExpression[2 ArcTan[x], -1 < x < 0 || 0 < x < 1]}}
$\begin{array}{cc}
\{ &
\begin{array}{cc}
-\log \left(x^2+1\right)+2 x \tan ^{-1}(x)+\log (4) & -1<x\leq 1 \\
\log \left(x^2+1\right)+2 x \tan ^{-1}\left(\frac{1}{x}\right) & \text{True} \\
\end{array}
\\
\end{array}$
True