2. Given the infinite sequence $\left\{a_{n}\right\}$ satisfies $a_{0}=x, a_{1}=y, a_{n+1}=\frac{a_{n} a_{n-1}+1}{a_{n}+a_{n-1}}, n=1,2, \cdots$.
(1) For which real numbers $x$ and $y$, does there always exist a positive integer $n_{0}$, such that when $n \geqslant n_{0}$, $a_{n}$ is always a constant?
(2) Find the general term $a_{n}$.
(1) Since $a_{n}-a_{n+1}=a_{n}-\frac{a_{n} a_{n-1}+1}{a_{n}+a_{n-1}}=\frac{a_{n}^{2}-1}{a_{n}+a_{n-1}}$, we know that for some positive integer $n$, when $a_{n}^{2}-1=0 \Rightarrow a_{n}-a_{n+1}=0 \Rightarrow a_{n}$ is always a constant, noting that the denominator $a_{n}+a_{n-1} \neq 0$, so when $n=1$ there must be $|y|=1$ and $y+x \neq 0$; when $n \geqslant 2$, $a_{n+1}-1=\frac{a_{n} a_{n-1}-a_{n}-a_{n-1}+1}{a_{n}+a_{n-1}}=\frac{\left(a_{n}-1\right)\left(a_{n-1}-1\right)}{a_{n}+a_{n-1}}$, $a_{n+1}+1=\frac{a_{n} a_{n-1}+a_{n}+a_{n-1}+1}{a_{n}+a_{n-1}}=\frac{\left(a_{n}+1\right)\left(a_{n-1}+1\right)}{a_{n}+a_{n-1}}$,
(2) Multiplying the two equations gives $a_{n+1}^{2}-1=\frac{a_{n}^{2}-1}{a_{n}+a_{n-1}} \cdot \frac{a_{n-1}^{2}-1}{a_{n}+a_{n-1}}$, when $a_{n}^{2}-1=0$ or $a_{n-1}^{2}-1=0 \Rightarrow a_{n+1}^{2}-1=0$, combining (1) and (2), we know that $a_{n}$ is always a constant. Also noting that the denominator $a_{n}+a_{n-1} \neq 0$, thus when $n \geqslant 2$ there is $|x|=1$ and $y+x \neq 0$ or $|y|=1$ and $y+x \neq 0$.
(2) Dividing the two equations from (1) and (2), we get $\frac{a_{n+1}-1}{a_{n+1}+1}=\frac{a_{n}-1}{a_{n}+1} \cdot \frac{a_{n-1}-1}{a_{n-1}+1}, n \geqslant 2$. Let $b_{n}=\frac{a_{n}-1}{a_{n}+1}$, then $b_{n+1}=b_{n} b_{n-1} \Rightarrow b_{2}=b_{1} b_{0}, b_{3}=b_{2} b_{1}=b_{1}^{2} b_{0}, b_{4}=b_{3} b_{2}=b_{1}^{3} b_{0}^{2}, \cdots$, thus $b_{n}=b_{1}^{F_{n-1}} b_{0}^{F_{n-2}}, n \geqslant 2$, where $F_{0}=F_{1}=1, F_{n+1}=F_{n}+F_{n-1}$. By Fibonacci sequence knowledge, $F_{n}=\frac{1}{\sqrt{5}}\left[\left(\frac{1+\sqrt{5}}{2}\right)^{n+1}-\left(\frac{1-\sqrt{5}}{2}\right)^{n+1}\right]$, so $\frac{a_{n}-1}{a_{n}+1}=\left(\frac{y-1}{y+1}\right)^{F_{n-1}} \cdot\left(\frac{x-1}{x+1}\right)^{F_{n-2}}$ $\Rightarrow a_{n}=\frac{(x+1)^{F_{n-2}}(y+1)^{F_{n-1}}+(x-1)^{F_{n-2}}(y-1)^{F_{n-1}}}{(x+1)^{F_{n-2}}(y+1)^{F_{n-1}}-(x-1)^{F_{n-2}}(y-1)^{F_{n-1}}}$. Define $F_{-2}=1, F_{-1}=0$, the above general term formula holds for all $n \in \mathbf{N}$.