12 (18 points) The inverse function of $f(x)$ is $y=\frac{x}{1+x}, g_{n}(x)+\frac{1}{f_{n}(x)}=0$, let $f_{1}(x)=f(x)$, and for $n>1, n \in \mathbf{N}^{*}$, $f_{n}(x)=f_{n-1}\left[f_{n-1}(x)\right]$. Find the analytical expression for $g_{n}(x)\left(n \in \mathbf{N}^{*}\right)$.
12. From $y=\frac{x}{1+x}$, it is easy to get $f(x)=\frac{x}{1-x}$. From $g_{n}(x)+\frac{1}{f_{n}(x)}=0$,

we have $g_{n}(x)=-\frac{1}{f_{n}(x)}$.
Also, $f_{1}(x)=f(x)$, so
$$
\begin{array}{c}
f_{2}(x)=f_{1}\left[f_{1}(x)\right]=\frac{\frac{x}{1-x}}{1-\frac{x}{1-x}}=\frac{x}{1-2 x}, \\
f_{3}(x)=f_{2}\left[f_{2}(x)\right]=\frac{\frac{x}{1-2 x}}{1-\frac{2 x}{1-2 x}}=\frac{x}{1-2^{2} x}, \\
\ldots \ldots .
\end{array}
$$

From this, we conjecture that $f_{n}(x)=\frac{x}{1-2^{n-1} x}\left(n \in \mathbf{N}^{*}\right)$.
Next, we use induction for $n \in \mathbf{N}^{*}$.
When $n=k$, $f_{k}(x)=\frac{x}{1-2^{k-1} x}$.
When $n=k+1$, we have
$$
\begin{aligned}
f_{k+1}(x) & =f_{k}\left[f_{k}(x)\right]=\frac{f_{k}(x)}{1-2^{k-1} f_{k}(x)} \\
& =\frac{\frac{x}{1-2^{k-1} x}}{1-2^{k-1} \frac{x}{1-2^{k-1} x}}=\frac{\frac{x}{1-2^{k-1} x}}{\frac{1-2^{k-1} x-2^{k-1} x}{1-2^{k-1} x}} \\
& =\frac{x}{1-2^{k} x} .
\end{aligned}
$$

When $n=k+1$, the conjecture holds, so for all $n \in \mathbf{N}^{*}$, we have $g_{n}(x)=$ $-\frac{1}{f_{n}(x)}=2^{n-1}-\frac{1}{x}$.