Ta có: \(\frac{a^2+a+3}{a+1}=\frac{a.\left(a+1\right)+3}{a+1}=a+\)\(\frac{3}{a+1}\)
Để \(\frac{a^2+a+3}{a+1}\)là số nguyên\(\Rightarrow a+\frac{3}{a+1}\)nguyên. Mà a nguyên\(\Rightarrow\frac{3}{a+1}\)nguyên
\(\Rightarrow3⋮a+1\)\(\Rightarrow a+1\inƯ\left(3\right)=\left\{-1;1;-3;3\right\}\)
\(\Rightarrow a\in\left\{-2;0;-4;2\right\}\)