2. The range of the function $f(x)=\frac{\sqrt{x^{2}+1}}{x-1}$ is
Let $x=\tan \theta, \theta \in\left(-\frac{\pi}{2}, \frac{\pi}{4}\right) \cup\left(\frac{\pi}{4}, \frac{\pi}{2}\right) \Rightarrow \theta-\frac{\pi}{4} \in\left(-\frac{3 \pi}{4}, 0\right) \cup\left(0, \frac{\pi}{4}\right)$,
thus $f(x)=\frac{\sec \theta}{\tan \theta-1}=\frac{1}{\sin \theta-\cos \theta}=\frac{1}{\sqrt{2} \sin \left(\theta-\frac{\pi}{4}\right)}$.
Since $\sin \left(\theta-\frac{\pi}{4}\right) \in[-1,0) \cup\left(0, \frac{\sqrt{2}}{2}\right) \Rightarrow f(x) \in\left(-\infty,-\frac{\sqrt{2}}{2}\right] \cup(1,+\infty)$,
the range of the function $f(x)$ is $\left(-\infty,-\frac{\sqrt{2}}{2}\right] \cup(1,+\infty)$.