Characteristic polynomial of the matrix with zeros on the diagonal and ones elsewhere

Let $M$ be the matrix in question. Then $M=J-I$ where $J$ is the all-ones matrix. Then $$\chi_M(t)=\det(tI-M)=\det(tI+I-J)=\chi_J(t+1).$$ We just need to compute the characteristic polynomial of $J$, But $J^2=nJ$, so the eigenvalues of $J$ are in the set $\{0,n\}$. The trace of $J$ is $n$, so that one eigenvalue of $J$ is $n$ and the other $n-1$ are all zero. That is, $\chi_J(t)=t^{n-1}(t-n)$. Then $$\chi_M(t)=(t+1)^{n-1}(t-n+1).$$


Let the matrix be $A$. It's much easier to find the characteristic polynomial of $B=A+I$, the matrix that is all $1$s: we can do this by finding the eigenvectors, which will give us the eigenvalues. Then the eigenvalues of $A$ will just be those of $B$ with a $-1$, since $Bx=\lambda x \iff Ax = (\lambda-1)x$.

So what are the eigenvectors of $B$? It's so symmetric that it's easy to write a few down: the vector that is all $1$s has eigenvalue $n$, while any vector whose components sum to zero is an eigenvector with eigenvalue $0$. There are at least $n-1$ of these, since $e_1-e_i$ for $2 \leq i \leq n$ is a linearly independent subset of the eigenspace. Thus $0$ is an eigenvalue with multiplicity at least $n-1$, but we know the other eigenvalue already, so this is everything. Hence the characteristic polynomial is $(t-n)t^{n-1}$.

Returning to $A$, we find that this gives the characteristic polynomial of $A$ as $(t-n+1)(t+1)^{n-1}$.