There is a lemma in the second addition of Artin's Algebra (Chapter 10 on Representation Theory) used to prove the orthogonality relations for irreducible characters:
$\textbf{Lemma :}$ Let $T$ be an operator on the space $\mathbb{C}^{m \times n}$ of $m \times n$ complex matrices, defined as
$T(M) = AMB$, where $A$ is some $m \times m$ complex matrix and $B$ some $n \times n$ complex matrix.
Then trace $T =$ trace$(A)$trace$(B)$.
One can construct an "eigenmatrix" (Is this terminology standard?) of $T$ from an eigenvector $x$ of $A$ and $y$ of $B^T$, namely the matrix $xy^T$. Consequently if $x$ was an eigenvector of eigenvalue $\lambda$ and $y$ of eigenvalue $k$, then the eigevalue of the eigenmatrix $xy^T$ is $\lambda k$.
Now to find the trace of $T$, one needs all its eigenvalues. A sufficient but perhaps not necessary condition would be if $T$ has $mn$ distinct eigenvalues. If it does then the lemma in Artin above follows immediately.
However the question that arises is if $T$ does not have $mn$ distinct eigenvalues. Artin does mention of constructing a sequence of matrices $A_k \rightarrow A$ and $B_k \rightarrow B$ such that each of these have distinct eigenvalues and the product of their eigenvalues is distinct for all $k$. He the proceeds to say that the lemma follows by continuity.
I find this argument not rigorous - how can one choose a sequence matrices $A_k$ and $B_k$ like that? Can it made to be rigorous? Someone said to me that one can prove this lemma by using Jordan normal form. Does anyone know of a proof using Jordan form?
$\textbf{ Update :}$ This lemma is more easily proven by bashing out the algebra as shown in Robert and Hans's answers below. However, how about if we were to ask of computing the eigenvalues of $T$?
Thanks.