Finding $n$ such that $\frac{n^4 + 1}{n^2 +n + 1}$ is an integer 
Find all integers such that $\dfrac{n^4 + 1}{n^2 +n + 1}$ is an integer. 

I have no idea how to solve things like this and what i tried to do didn't get me anywhere. I'd be grateful for any help! 
 A: Using polynomial division, we can write the expression as $\frac{n+1}{n^2+n+1}+n^2-n$, which is an integer only when $n=0$ or $n=-1$.
A: Hint: Divide one polynom by another and consider the remainder.
A: HINT:
$$n^4+n^2+1=(n^2)^2+1^2+n^2=(n^2+1)^2-n^2=(n^2-n+1)(n^2+n+1)$$
$$\implies \frac{n^4+1}{n^2+n+1}=n^2-n+1-\frac{n^2}{n^2+n+1}$$
So, $n^2+n+1$ must divide $n^2$
But $(n^2,n^2+n+1)=1$ (Proof Below)
$\implies n^2+n+1=\pm1$ as $ n^2+n+1$ being denominator $\ne0$
If $ n^2+n+1=-1\implies n^2+n+2=0\implies n=\frac{-1\pm\sqrt{1^2-4\cdot1\cdot2}}2=\frac{-1\pm\sqrt7i}2$ which is not real.
If $ n^2+n+1=1\implies n(n+1)=0\implies n=0,-1$
[
Proof :
 If prime $p>1$ divides both $n^2, n^2+n+1$
$p$ will divide $(n^2+n+1)-n^2=n+1$
As $p$ is prime, $p$ divides $n^2\implies p$ divides $n$
Then $p$ divides $(n+1)-n=1$ clear contradiction as $p>1$
]
A: Doing the elementary polynomial division we get:
$\frac{n^4 + 1}{n^2 +n + 1}=n^2-n+ \frac{n+1}{n^2+n+1}$
We do not need to consider now $n^2-n$ since it is always an integer(for integers $n$). Then observe $|\frac{n+1}{n^2+n+1}|\leq1$. So we do not have many chances that it will be an integer; it is $-1$, $0$, $1$. Write each equality case explicitly and see easily that the solutions are: $n=0$ and $n=-1$.
