Does the equation $(AB-BA)^2=I_n$ have a solution for each $n\geq 3$? 
Does the equation $(AB-BA)^2=I_n$ have a solution for each $n\geq 3$? $A$ and $B$ are matrices?

I found out that the equation $(AB-BA)^m=I_n$ does have solution when $n=kp$ where $k$ is an arbitrary integer number. It should be noted that $m>1$ is an integer number. To prove, we just need to consider $C=\operatorname{diag}(r_1,..., r_m)$ where $r_1,..., r_m$ are the roots of $x^m-1=0$, i.e., the eigenvalues of matrix $C$. In this case we know $\operatorname{trace}(C)=0$, and so there is two matrices $A$ and $B$ such that $C=AB-BA$, and also it is vivid that $C^m=I_m$. For each $n=km$, we can duplicate the matrix $C$, $k$ times to get an $mk\times mk$ matrix to consider as new matrix $C$. Now, my new question is this:

Is this an iff condition? I mean that does the equation $(AB-BA)^m=I_n$ have answer if and only if $n=mk$?

 A: Let $$
U = \frac{1}{2}\begin{bmatrix}
0 & 1 \\ -1 & 0 
\end{bmatrix}, 
V = \begin{bmatrix}
0 & 1 \\ 1 & 0 
\end{bmatrix}
$$
Then 
$$
UV = \frac{1}{2}\begin{bmatrix}
1 & 0 \\ 0 & -1 
\end{bmatrix},
VU = \frac{1}{2}\begin{bmatrix}
-1 & 0 \\ 0 & 1 
\end{bmatrix}
$$
hence 
$$
UV - VU = \begin{bmatrix}
1 & 0 \\ 0 & -1 
\end{bmatrix}
$$
and its square is the identity. 
To create a $2n \times 2n$ matrix with the same characteristic, let $A_n$ consist of $n$ copies of $U$ along the diagonal in blocks, and let $B_n$ be $n$ copies of $V$ along the diagonal in blocks. Then $$(A_n B_n - B_n A_n)^2 = I_{2n}.$$
This leaves open the question for matrices of odd size. Offhand, I'm guessing that there might be no solution in that case, but perhaps there's something similar to this one, where $AB - BA$ turns out to be rotation by $\pi$ about the axis $(1,1,1)$ or something. 
Post-comment remarks
Will Jagy closes this out by noting that if $n$ is odd, and you have a solution consisting of matrices $A$ and $B$, then you can let
$$
W = AB - BA
$$
This can be put in Jordan normal form so that 
$$
P^{-1} W P
$$
is a Jordan-block matrix. And its square is the identity, because it's $P^{-1} W^2 P$, and $W^2$ is assumed to be $I$. The square of a jordan block is the identity only if the block itself is diagonal, hence $P^{-1}WP$ is diagonal. 
Replacing $A$ and $B$ with $A' = P^{-1}AP$ and $B' = P^{-1} B P$, we have 
$$
A'B' - B'A' = P^{-1} W P
$$ 
is diagonal, and its square is still the identity. Hence all its diagonal entries are $\pm 1$, so its trace is $\pm 3$ or $\pm 1$. But in general, $tr(AB - BA) = 0$, so we have a contradiction. 
Conclusion: for odd $n$, there are no such matrices $A$ and $B$. 
A: This is Will Jagy's idea: Let $C = AB - BA$. If $C^2 = I$, then $(C - I)(C + I) = 0$. This implies $C$ is diagonalizable and its only eigenvalues are $\pm 1$. So we can pick a basis such that $C$ is diagonal. Now, for any matrices $A$ and $B$, we have $\text{tr}(AB - BA) = 0$, where $\text{tr}$ denotes the trace. But since $AB - BA = C$ is diagonal, the trace of $C$ is the sum of its eigenvalues. If all the eigenvalues are $\pm 1$, the multiplicity of $1$ must equal the multiplicity of $-1$, which is impossible if $n$ is odd.
To prove that $C$ is diagonalizable: One way to see this is to prove that any vector $\mathbf{v}$ can be written as $\mathbf{v} = \mathbf{v}_{+} + \mathbf{v}_{-}$, where $\mathbf{v}_{+/-}$ are eigenvectors of $C$ with eigenvalues $\pm 1$, respectively. To do this, we can just set $\mathbf{v}_{+} = \frac{1}{2}(I - C)\mathbf{v}$ and $\mathbf{v}_{-} = \frac{1}{2}(I + C)\mathbf{v}$. The identity $(C - I)(C + I) = 0$ implies that these are eigenvectors with the proper eigenvalues.
A: The other answers have dealt with the case of even $n$ nicely. Their disproofs for the existence of $A,B$ when $n$ is odd also work when the characteristic of the field is zero.
Since the OP does not specify the field, it is worth pointing out that $AB-BA=I$ is solvable if and only if $I$ is traceless. Therefore, when the field has characteristic $p>0$, $(AB-BA)^2=I$ could be solvable when $n$ is appropriate. E.g. if $n=p$ is an odd prime and the field is $GF(p)$, we have $AB-BA=I$ when
$$
A=\pmatrix{0\\ 1&0\\ &\ddots&\ddots\\ &&\ddots&\ddots\\ &&&1&0},
\quad B=\pmatrix{0&-1\\ &0&-2\\ &&\ddots&\ddots\\ &&&0&1-p\\ &&&&0}.
$$
