Let $A,B$ be commuting matrices such that some positive power of each matrix is the identity. Prove that there is an invertible matrix $P$ such that $PAP^{-1}$ and $PBP^{-1}$ are both diagonal.
Similar questions to this have been asked on here a number of times, and I understand the solution that one can prove that $A$ and $B$ have the same eigenvectors forming a basis for the vector space, so if we change to that basis both $A$ and $B$ will be diagonal.
My confusion comes from where I found this question. It is an exercise from chapter 10 of Algebra, by Artin, on group representations. I'm finding it difficult to see the connection between this problem and group representations. Some thoughts I had were that there are one dimensional representations of $A$, $B$ and $AB$, but I failed to find any connection between that and diagonalization.
What is the connection between this problem and group representations? Is there a version of a proof for this problem that mainly uses the theory behind group representations?