I saw a question that asks in the first part to prove that if $A, B \in M_n(\mathbb C)$ such that $AB=BA$ and for any 2 polynomials $f$ and $g$, we have $f(A)g(B)=g(B)f(A)$. Thats not difficult.
In the second part the question wa to prove that $A^{−1}=p(A)$ for some polynomial with complex coefficients. So how can I use part 1 to prove part 2? Or are they not related to each other ?
I think in general they use the fact that the characteristic polynomial $c_A(t) = \det(t I - A)$ of any square matrix $A$ satisfies $c_A(A) = 0$.
But I also didn't know how to prove from here.
The characteristic polynomial is $\chi_A(s) = \det (sI-a)$ and the Cayley Hamilton theorem tells us that $\chi_A(A) = 0$. Since $A$ is invertible, we have $c_0=\chi_A(0) \neq 0$ (the parameter $0$ means the scalar zero) and so we have $\chi_A(A) = 0 = A^n+c_{n-1}A^{n-1}+\cdots+ c_1A +c_0 I = 0$. Now multiply through by $A^{-1}$ to get $A^{n-1}+c_{n-2}A^{n-1}+\cdots+ c_1 I +c_0 A^{-1} = 0$, from which we get $A^{-1} = - {1 \over c_0} (A^{n-1}+c_{n-2}A^{n-1}+\cdots+ c_1 I)$.