<s>[INST] 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}$
 [/INST] 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} $$
</s>