\(\frac{n^2+1}{n-1}\in Z\Leftrightarrow n^2+1⋮n-1\Leftrightarrow\left(n^2+1\right)-\left(n+1\right)^2⋮n-1\Leftrightarrow-2n⋮n-1\Leftrightarrow-2n+2n-2⋮n-1\Leftrightarrow-2⋮n-1\Leftrightarrow n-1\inƯ\left(-2\right)\Leftrightarrow n-1\in\left\{-1;1;-2;2\right\}\Leftrightarrow n\in\left\{0;2;-1;3\right\}\)