How to find the inverse function of the function $f$, defined as $f(x)=\frac{x}{1-x^2}$ for $-1 \lt x \lt 1$ I want to find the inverse function of the function $f$, defined as $f(x)=\frac{x}{1-x^2}$ for $-1 \lt x \lt 1$.
Letting $y=f(x)$, we first note that $x=0 \iff y=0$. Next, we consider the case when $y \neq 0$:

$y=\frac{x}{1-x^2} \implies-x^2y+y-x=0 \implies x^2+\frac{x}{y}-1=0 \implies \left(x+\frac{1}{2y}\right)^2-\left(1+\frac{1}{4y^2} \right)=0$

, which can be simplified to:

$\left|x+\frac{1}{2y} \right|=\sqrt{1+\frac{1}{4y^2}} \quad (*)$

If $x+\frac{1}{2y}\gt 0$, then we have: $g_1(y)=x=\sqrt{1+\frac{1}{4y^2}}-\frac{1}{2y}$
If $x+\frac{1}{2y} \lt 0$, then we have: $g_2(y)=x=(-1)\cdot\sqrt{1+\frac{1}{4y^2}}-\frac{1}{2y}$
In its current state, the collection of $(y,x)$ that satisfies $(*)$ does not represent a function...because for a single $y$, there is more than one $x$ that satisfies $(*)$.
Without making reference to graphing software, how does one determine the appropriate inverse for $f$?
Is there a standard procedure? One might argue that I should just try $g_1 \circ f$, $f \circ g_1$, $g_2 \circ f$, and $f \circ g_2$ and see which yield the $I$...but it seems to me like this doesn't necessarily exhaust all possibilities. For example, what if the true inverse is chopped up and pasted together versions of $g_1$ and $g_2$, so as to avoid the doubled values. i.e. let $g_3(x) = \begin{cases}g_1(x) &\text{ if } x \in (a,b)\\ g_2(x) &\text{ if }x \notin (a,b)\end{cases}$
 A: To find the inverse function, you have to solve for $x$ the equation $y=\frac{x}{1-x^2}\Leftrightarrow yx^2+x-y=0$ with the restriction $-1<x<1$. When $y=0$, we get $x=0$. When $y\ne 0$, this is a quadratic equation with roots $$x=\frac{-1\pm\sqrt{1+4y^2}}{2y}.$$
Now you have to examine the two roots and determine whether they lie in the interval $(-1,1)$. For $y>0$, you can verify that
$$0<\frac{-1+\sqrt{1+4y^2}}{2y}<1,\quad\quad\quad
\frac{-1-\sqrt{1+4y^2}}{2y}<-1 $$
so $x=\frac{-1+\sqrt{1+4y^2}}{2y}$ is the correct root and the other one must be discarded. Similarly, when $y<0$, we have
$$-1<\frac{-1+\sqrt{1+4y^2}}{2y}<0,\quad\quad\quad
\frac{-1-\sqrt{1+4y^2}}{2y}>1$$
so again we discard the second root and keep the other one. Putting everything together, the inverse function is
$$f^{-1}(x)=
\begin{cases}
0, & x=0\\
\frac{-1+\sqrt{1+4x^2}}{2x}, & x\ne 0\end{cases} $$
A: I will retain the notation found in the original question...starting from:
$$\left|x+\frac{1}{2y} \right|=\sqrt{1+\frac{1}{4y^2}}$$
This expression means that for any $y \in \mathbb R \setminus \{0\}$:

$x=\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y} \ \lor\ x=(-1)\cdot\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y} \quad (*)$

First suppose that $y \lt 0$. Assume that  $x=\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}$. If $y \lt 0$, then $-\frac{1}{2y} \gt 0$. Given that $\sqrt{\left(1+\frac{1}{4y^2}\right)} \gt 1$, we must have that $x \gt 1$.
Next, suppose that $y \gt 0$. Assume that $x=(-1)\cdot\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}$. If $y \gt 0$, then $-\frac{1}{2y} \lt 0$. Given that $(-1)\cdot\sqrt{\left(1+\frac{1}{4y^2}\right)} \lt -1$, we must have that $x \lt -1$.
Now, our original function $f$ is defined on the open interval $(-1,1)$. This means that the inverse function $f^{-1}$ must necessarily have an image of $(-1,1)$.
In order for $(*)$ to be upheld, we must then have the following:
(1) If $y \lt 0$, then $x=(-1)\cdot\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}$
(2) If $y \gt 0$, then $x=\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}$
Letting $x = f^{-1}(y)$, we have the following description of $f^{-1}$:
$$f^{-1}(y)=\begin{cases}(-1)\cdot\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}&\text { if } y\lt 0 \\0 &\text { if } y= 0\\\sqrt{\left(1+\frac{1}{4y^2}\right)}-\frac{1}{2y}&\text { if } y\gt 0 \end{cases}$$
A: An alternative to answers posted. Let $x(t)=\tan(t)$, so $$f(x(t))=\frac{\tan(t)}{1-\tan^2(t)}=\frac12\tan(2t)$$
So $$\tan(t)=x(t)=f^{-1}\left(\frac12\tan(2t)\right)$$
Let $y=\frac12\tan(2t)$, so that $t=\frac12\arctan(2y)$. And substituting these into the previous equation:
$$\tan\left(\frac12\arctan(2y)\right)=f^{-1}(y)$$
So you have that formula for $f^{-1}$. Writing back in terms of a generic variable $x$, $$f^{-1}(x)=\tan\left(\frac12\arctan(2x)\right)$$
If you don't like leaving it in terms of trig functions, you could start with a half-angle formula for tangent:
$$\begin{align}
f^{-1}(x)&=\tan\left(\frac12\arctan(2x)\right)\\
&=\frac{\tan\left(\arctan(2x)\right)}{\sec\left(\arctan(2x)\right)+1}\\
&=\frac{2x}{\sqrt{4x^2+1}+1}\\
\end{align}$$
