\(n+1⋮n^2+1\Rightarrow n\left(n+1\right)⋮n^2+1\)
\(\Rightarrow n^2+1+n-1⋮n^2+1\)
\(\Rightarrow n-1⋮n^2+1\)
\(\Rightarrow n+1-\left(n-1\right)⋮n^2+1\)
\(\Rightarrow2⋮n^2+1\)
\(\Rightarrow n^2+1=Ư\left(2\right)\)
Mà \(n^2+1\ge1;\forall n\Rightarrow\left\{{}\begin{matrix}n^2+1=1\\n^2+1=2\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}n^2=0\\n^2=1\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}n=0\\n=-1\\n=1\end{matrix}\right.\)