Why is it that if $f,g\,\,$ are endomorphisms and they commute then one of them is a polynomial with the "argument" being the other? It is easy to see that if that were true, $f,g\,\,$ would commute. What I fail to see is the converse. Thanks.
I will write it this way: given a square matrix $M,$ then all matrices that commute with $M$ can be written as a polynomial in $M$ when:
All eigenvalues of $M$ are distinct, or, at least, whenever an eigenvalue has multiplicity larger than one, it has just a single Jordan block, call it multiplicity $k,$ Jordan block $k$ by $k,$ with $k-1$ occurrences of $1$ on the superdiagonal.
This is true if and only if the characteristic polynomial and the minimum polynomial are equal.
Those are all. That is, the following two conditions for a square matrix $M$ with real or complex entries are equivalent:
(I) All matrices that commute with $M$ can be written as a polynomial in $M.$
(II) The characteristic polynomial and the minimal polynomial of $M$ are the same.
See Corollary 1 to Theorem 2 on page 222 of The Theory of Matrices, Volume 1 by Feliks Ruvimovich Gantmakher.
and a reference provided in a comment by Richard Stanley there,