You have changed your question, now it is easy.
Note that $n^n-1$ divides $n^2-1$ whenever $2 | n$. Hence, if $n$ is even, the answer is $0$, since $\frac{n^n-1}{(n+1)(n-1)}$ will be an integer.
Suppose that $n$ is odd. Note that $n \equiv -1 \mod n+1$. Hence, it is legitimate to replace $n$ by $-1$ in the modular expression, and this gives
$$
\frac{n^n-1}{n-1} = \sum_{i=0}^{n-1} n^i \equiv \sum_{i=0}^{n-1} (-1)^i \equiv 1 \mod n+1
$$
because one factor of $1$ gets left out as $n$ is odd, so $n-1$ is even.
Hence, the answer is zero for even $n$, and $1$ for odd $n$.
Edit: You can multiply and check that $$
(n-1) (1 + n + n^2 + \ldots + n^{n-1}) = n^n-1
$$