I have been given a diagonalizable matrix $A \in K^{n \times n}$ and a polynomial $f \in K[X]$ for a field $K$. I need to prove that $f(A)$ is diagonalizable. Because the matrix $A$ is a arbitrary matrix, it follows: $$A = \left(\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array}\right) \in K^{n \times n} \, for \, a_1,\dots,a_n \in K.$$ Assuming that $f$ is a normalized polynomial, it follows: $$f = X^n + a_{n-1}X^{n-1} + \dots + a_1X + a_0$$
My first idea was to simply insert the given the matrix $A$ in the polynomial $f$ which results in the following: $$f(A) = \left(\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array}\right)^n + a_{n-1} \left(\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array}\right)^{n-1} + \dots + a_1\left(\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array}\right)^1 + a_0 \left(\begin{array}{cccc} 1 & 0 & \cdots & 0\\ 0 & 1 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1 \end{array}\right)$$ I know that in order to determine the matrix $A^n$ I can use the following: $$A^n = TB^nT^{-1} \text{$\,$ where B is a diagonal matrix}.$$ I know such matrix $B$ exists because matrix $A$ is diagonalizable, so $A$ is similar to a diagonal matrix. I don't know if this is the right approach because from this point on I am stuck.