I'm trying to find the inverse of the function $$ f(x)=1+x|x| $$
I tried to do this: $$ y=1+x|x| \\x=1+y|y| \\y|y|=x-1 \\(y|y|)^2=(x-1)^2 \\y^4=(x-1)^2 \\y=\sqrt{x-1}$$
which I believe is wrong because the domain of the function includes negative numbers, while $\sqrt{x-1}$ is always positive.
What is the correct inverse of the function and how to find it?
A bit of detail:
Let $D_f= \mathbb{R}$.
1) Check if $f(x) = 1+x|x|$ has an inverse.
$f_{\ge}(x):= f(x) = 1+x^2$ , for $x\ge 0$, strictly increasing .
$f_{\lt}(x)=f(x) = 1-x^2$ , for $x\lt 0$ , strictly decreasing.
2) Now you invert $f_{\ge}$ and $f_{\lt}$,
(User Mohammad).