Note that n5+n4+1=(n3−n+1)(n2+n+1), and that
d=gcd(n3−n+1,n2+n+1)=gcd(n2+n+1,−n2−2n+1)=gcd(n2+n+1,n−2)=gcd(n−2,7),
hence we have two cases:
1) d=7
This implies 7∣m and 7∤n, from which we get 7∣m−7n and 7∤m−4n.
Therefore, there is no solution in this case.
2) d=1
This implies that n3−n+1 and n2+n+1 are both squares of integers. That is true only for n=0 and n=−1, since n2<n2+n+1<(n+1)2 holds for n≥1, and (n+1)2<n2+n+1<n2 holds for n<−1.
Both n=0 and n=−1 yield m2=1, i.e. m=±1, and among four possibilities only two satisfy the given conditions: (m,n)=(−1,0) and (m,n)=(1,0).