Let $A$ and $B$ are two $n \times n$ Complex matrices. Assume that $(A-I)^n=0$ and $A^kB=BA^k$ for some $k \in \mathbb{N}$. Then I want to prove that $AB= BA$.
Clearly $1$ is the only eigen value of $A$ and also $A^k$ and $B$ are simultaneously triangulable. But how do I get down to $A$ to commute with $B$. Any help will be appreciated. Thanks.
Hint. Try to prove that $A$ is a polynomial in $A^k$.
Edit. To prove the hint, you may follow darij grinberg's comment below. I did essentially the same thing, but from a matrix analytic rather than linear algebraic perspective: I considered the primary matrix function $f(X)=(I+X)^{1/k}=\sum_{i=0}^\infty \frac{f^{(i)}(0)}{k!}X^i$ for a nilpotent matrix $X$ associated with the scalar function $f(x)=(1+x)^{1/k}$. Put $X=A^k-I$ and we are done.
Alternatively, the hint can be proved using only Jordan forms, but the argument is much longer.