Consider the set of all square matrices with $n$ columns over $K(\Bbb{R} \text{ or} \Bbb{C})$: $\mathcal{M}_n({K}) $
Define $Z(\mathcal{M}_n({K})) = \{A\in \mathcal{M}_n({K}) : AB=BA, \forall B \in \mathcal{M}_n({K}) \}$
$C(A) =\{B\in \mathcal{M}_n({K}): AB=BA \}$
Then $Z(\mathcal{M}_n({K}))=\{cI_n : c\in K\}$
For any $A\in \mathcal{M}_n({K})$,
$Z(\mathcal{M}_n({K}))\subset C(A) $
Again $\{f(A): f(x) \in K[x]\}\subset C(A) $
In fact any scalar matrix $cI_n$ is also a polynomial in $A$ i.e $f(A) =cI_n $ where $f\in K[x]$ is the constant polynomial $f(x) =c, c\in K$
Now I am interested in those $A\in \mathcal{M}_n({K})$ for which $C(A)=\{f(A): f(x) \in K[x]\}$
I want to study all properties of such matrix $A$
Minimal polynomial of $A$
Characteristics polynomial of $A$
Diagonalizability of $A$
Nilpotency of $A$
If $B$ is another such matrix then the simultaneous diagonalizability of $A$ and $B$
unitarily diagonalizability of $A$ and $B$.
Lastly if $$C(A) =\{f(A): f(x) \in K[x] \text{ irreducible} \}$$, then what are some interesting properties of $A$?
I'll deal with the complex case to avoid issues with eigenvalues.
This makes the answers to all the questions above, trivial.
Because both sides in $(1)$ are invariant under similarity we may assume that $A$ is in Jordan form.
Note that $f(A)$ is obtained by applying $f$ to each Jordan block. If the same eigenvalue appears in two Jordan blocks, then $$ \begin{bmatrix}J_n(\lambda)\\ & J_m(\lambda)\end{bmatrix} \begin{bmatrix}1\\ & 2\end{bmatrix} =\begin{bmatrix}1\\ & 2\end{bmatrix} \begin{bmatrix}J_n(\lambda)\\ & J_m(\lambda)\end{bmatrix} $$ and $\begin{bmatrix}1\\ & 2\end{bmatrix}$ cannot be obtained as $f(A)$ since both blocks will have $f(\lambda)$ in the diagonal. So, no eigenvalue is repeated. Using this one can deduce that any matrix that commutes with $A$ is block-diagonal with blocks the same size as those from $A$. That is, $$ A=\begin{bmatrix}J_{n_1}(\lambda_1)\\ &\ddots\\ && J_{n_k}(\lambda_k)\end{bmatrix} $$ and if $B$ commutes with $A$ then $$ B=\begin{bmatrix}B_1\\ & \ddots\\ && B_k\end{bmatrix}. $$ Moreover, $B_jJ_{n_j}(\lambda_j)=J_{n_j}(\lambda_j)B_j$. This forces $B_j$ to be upper triangular with constant diagonals (i.e., a Toeplitz matrix). If the size of the block is 2 or more, it then easy to choose $B_j$ that is not of the form $f(J_{n_j}(\lambda_j))$. In the end, each Jordan block of $A$ has to be one-dimensional, so $A$ is diagonal with all its eigenvalues distinct.
Conversely, if $A$ is diagonalizable with distinct eigenvalues it is easy to check that any $B$ that commutes with $A$ is diagonal. As the eigenvalues of $A$ are distinct, it is always possible to find a polynomial $f$ with $B=f(A)$.