Solution (source code)

= Solution

Write $P=(P_{ij})_{i,j=1}^3$, where $P_{ij}:\mathbb C^{m_j}\to\mathbb C^{m_i}$. Block multiplication makes the commuting condition equivalent to
$$
P_{ij}R_j(g)=R_i(g)P_{ij}\qquad(\forall g\in G).
$$
Thus every block is an <intertwiner>. For $i\ne j$, the <irreducible representations> are inequivalent, so the <Schur lemma> gives $P_{ij}=0$. On each diagonal block, the same <Schur lemma> gives $P_{ii}=\lambda_iI_{m_i}$. Therefore
$$
\boxed{P=\begin{pmatrix}
\lambda_1I_{m_1}&0&0\\
0&\lambda_2I_{m_2}&0\\
0&0&\lambda_3I_{m_3}
\end{pmatrix},\qquad \lambda_1,\lambda_2,\lambda_3\in\mathbb C.}
$$
Conversely, every displayed <matrix> commutes with $R(g)$, proving both necessity and sufficiency. This <commutant of a semisimple representation> has complex <dimension> three. The parameters may vanish: $P$ was not required to be invertible.