Take a solution with $a+b$ minimal. Let $\frac{a^2+1}{ab-1}=k$.
If $a=1$ then $b-1\mid2$, so $b\in\{2,3\}$.
If $a=2$ then $2b-1\mid5$, so $b\in\{1,3\}$.
Otherwise, $a\ge3$. We have $a^2-kab+k+1=0$. By Vieta, there is another solution $a_0$ with:
$$a_0=\underbrace{kb-a}_{\in\mathbb Z}=\underbrace{\frac{k+1}a}_{>0},$$so $a_0\in\mathbb N$. Note that:
$$a^2-1>2a$$$$\Rightarrow 1>\frac{2a}{a^2-1}$$$$\Rightarrow b>\frac{2a}{a^2-1}$$$$\Rightarrow 2a+b<a^2b$$$$\Rightarrow a^2b+b<2a^2b-2a$$$$\Rightarrow \frac{a^2+1}{ab-1}<\frac{2a}b$$$$\Rightarrow k<\frac{2a}b$$$$\Rightarrow kb-a<a$$$$\Rightarrow a_0<a,$$contradiction.