5. The sequence of real numbers $\left\{a_{n}\right\}$ satisfies the conditions: $a_{1}=\frac{\sqrt{2}}{2}+1, a_{2}=\sqrt{2}+1, a_{n+1}+a_{n-1}=\frac{n}{a_{n}-a_{n-1}}+2$ $(n \geqslant 2)$, then the general term formula $a_{n}=(n \geqslant 1)$.
Solve:
By summarizing the first few terms of the sequence $\left\{a_{n}\right\}$, we can conjecture that $a_{n}=\frac{n \sqrt{2}}{2}+1$. We will prove this using mathematical induction. Assume that for all positive integers less than or equal to $n$, $a_{n}=\frac{n \sqrt{2}}{2}+1(n \geqslant 2)$. Substituting into the given equation, we have $a_{n+1}+\frac{(n-1) \sqrt{2}}{2}+1=\frac{n}{\frac{\sqrt{2}}{2}}+2=n \sqrt{2}+2 \Rightarrow a_{n+1}=\frac{(n+1) \sqrt{2}}{2}+1$. Thus, the conclusion also holds for $n+1$. In summary, the general term formula is $a_{n}=\frac{n \sqrt{2}}{2}+1(n \geqslant 1)$.