13.5.7 ** Given a fixed point $M(-1,2)$, line $l_{1}: y-a(x+1)$, curve $C: y=$ $\sqrt{x^{2}+1}, l_{1}$ intersects $C$ at points $A$ and $B$, $N$ is the midpoint of segment $A B$, line $l_{2}$ passes through points $M$ and $N$, and the x-intercept of $l_{2}$ is $m$, express $m$ as a function of $a$: $m=f(a)$. If $g(m)=\frac{2}{m+1}$, find the range of $g(f(a))$.
Given that the equation of the curve $C$ is $y^{2}-x^{2}=1(y \geqslant 1)$. From $y=a(x+1), a \neq 0$ we get $x-\frac{y}{a}-1$. Substituting this into the equation of the curve, we obtain $\left(1 \quad a^{2}\right) y^{2}-2 a y+2 a^{2}=0$. This equation has two distinct positive roots, which must be $\geqslant 1$ (since $\left.y^{2}-\left(\frac{y}{a}-1\right)^{2}-1\right)$. Therefore, we have
$$
\left\{\begin{array}{l}
\Delta=4 a^{2}-8 a^{2}\left(1-a^{2}\right)>0, \\
\frac{2 a}{1-a^{2}}>0, \\
1-a^{2}>0,
\end{array}\right.
$$

Solving this, we get $\frac{\sqrt{2}}{2}<a<1$. Let the coordinates of points $A$, $B$, and $N$ be $A\left(x_{1}, y_{1}\right)$, $B\left(x_{2}, y_{2}\right)$, and $N\left(x_{0}, y_{0}\right)$, respectively. Then
$$
y_{0}=\frac{y_{1}+y_{2}}{2}=\frac{a}{1-a^{2}}, x_{0}=\frac{y_{0}}{a}-1=\frac{a^{2}}{1-a^{2}} .
$$

The slope of line $l_{2}$ is $k=2 a^{2}+a-2$, so the equation of $l_{2}$ is $y-2=\left(2 a^{2}+a-2\right)(x+1)$. Setting $y=0$, we get $m=\frac{-2}{2 a^{2}+a-2}-1\left(a \neq \frac{-1 \pm \sqrt{17}}{4}\right)$. Therefore, $g(m)=-\frac{2}{m+1}=2 a^{2}+a-2, a \in\left(\frac{\sqrt{2}}{2}, \frac{\sqrt{17}-1}{4}\right) \cup\left(\frac{\sqrt{17}-1}{4}, 1\right)$, with its range being $\left(\frac{\sqrt{2}}{2}-1,0\right) \cup(0,1)$.