Non-diagonal n-th roots of the identity matrix 
Q. Are there $n$-th root analogs of this non-diagonal cube-root of the $3 \times 3$
identity matrix?

\begin{align*}
\left(
\begin{array}{ccc}
 0 & 0 & -i \\
 i & 0 & 0 \\
 0 & 1 & 0 \\
\end{array}
\right)^3
= \left(
\begin{array}{ccc}
 1 & 0 & 0 \\
 0 & 1 & 0 \\
 0 & 0 & 1 \\
\end{array}
\right)
\end{align*}
I am looking for $A^n=I$, where $I$ is any dimension $\le n$.
(A naive question: I am not an expert in this area.)
 A: We want to solve $A^n = I $ where $A$ and $I$ are $m \times m$
Let $ A = P \Lambda P^{-1} $
where $\Lambda = \text{diag}(\omega_1, \omega_2, \dots , \omega_m) $
where the $\omega_k$'s are $n$-roots of unity.  That is, $\omega_k = \exp\big(\dfrac{i 2 \pi j}{n} \big)$ ,$ k = 1,2,\dots,m $ and $ j \in \{ 0, 1, 2, ...., n-1 \} $
and $P$ is any invertible $ m \times m $ matrix.
Then $A^n = \big(P \Lambda P^{-1}\big)\big(P \Lambda P^{-1}\big)\dots \big(P \Lambda P^{-1}\big) = P^{-1} \Lambda^n P = P^{-1} I P = I $
A: You can take a rotation matrix that rotates $\phi=2\pi/n$ around some axis, for example in 3 dimensions:
$$R_\phi=\begin{pmatrix}
\cos \phi & \sin\phi &  0 \\
-\sin\phi &  \cos\phi &0 \\
0 & 0 & 1\\
\end{pmatrix}$$
This won't work for $n=2$ though, because $R_\phi$ is diagonal in that case like $R_\phi=\operatorname{diag}(-1,-1,1)$.
Then $R_\phi^n=I$ and $R_\phi^k\neq I$ for any $0<k<n$.  You can build new matrices using any invertible matrix $A$ and conjugate like
$$R_{\phi,A}:= AR_\phi A^{-1} \tag 1$$
then obviously:
$$R_{\phi,A}^n = (AR_\phi A^{-1})^n = A R_\phi^nA^{-1} = I$$
(I am not sure whether this could fix the case $n=2$ and produce some valid (non-diagonal) results.)
A: If $A^n = I$, i.e., $A^n - I = 0$, then the minimal polynomial $m_A$ of $A$ divides $p(x) := x^n - 1$. (For $n > 1$) one nondiagonal solution is the companion matrix of $p$ itself, namely,
$$C_p := \pmatrix{\cdot & 1 \\ I_{n - 1} & \cdot}$$ (indeed, $p = m_{C_p}$).
Notice that $C_p$ is the permutation matrix for the permutation (in fact $n$-cycle) $$\pmatrix{1 & 2 & \cdots & n - 1 & n}$$ of $n$ elements. More generally, the permutation matrix of any permutation of $n$ elements of order dividing $n$ (and not the identity permutation) yields another solution.
There are uncountably many solutions for any $n > 1$: Given any solution $A$ and any invertible matrix $S$, $SAS^{-1}$ is another solution provided it is not diagonal (since diagonality is a closed condition that by hypothesis is not always satisfied).
A: The most general solution of the equation $A^n=1$ among $m\times m$ complex matrices is
$$
A=SDS^{-1},
$$
where $S$ is an invertible matrix and $D$ is a diagonal matrix whose diagonal entries are $n^{th}$ roots of unity.
The reason is that the minimal polynomial of such a matrix $A$ divides the polynomial $x^n-1$, and hence has distinct roots, which in turn implies that $A$ is diagonalizable.
