How many cube roots does an $n\times n$ identity matrix have over $\mathbb C$? I thought there are infinite solutions, because if $A$ is a solution, then $Q^TAQ$  is also a solution, where $Q$ is an orthogonal matrix. But I used MATLAB to symbolically solve for the cube root of a $2\times 2$ identity matrix, I got 16 solutions. Every entry of the solutions is either $0$ or a cube root of $1$.
MATLAB is unable to solve for higher $n$. So how many cube roots does an $n\times n$ identity matrix have? $n^4$?

The identity matrix indeed has infinitely many real $k$th roots, for any $k$, whenever $n \geq 3$.
For one, we can note that the block matrix
$$
A = \pmatrix{\pmatrix{\cos(2 \pi/k) & \sin (2\pi/k)\\-\sin (2\pi/k) & \cos (2 \pi/k)} & \pmatrix{t I_{n-2}\\0}\\
0 & I_{n-2}}
$$
will always satisfy $A^k = I_n$, for any $t \in \Bbb R$.
In fact, the same is also true when $n = 2$.  We can take
$$
\pmatrix{\cos(2 \pi/k) & t\sin (2\pi/k)\\-\frac 1t\sin (2\pi/k) & \cos (2 \pi/k)}
$$
for any non-zero $t \in \Bbb R$.
