Suppose that $A$ is a square complex matrix and $f$ is a polynomial in $\mathbb C[t]$ such that $f(A)$ is diagonalizable. If $f'(A)$ is invertible, where $f'$ is the derivative of $f$, prove that $A$ is diagonalizable in $\mathbb C$.

My attempt:

Since $f(A)$ is diagonalizable, then the minimal polynomial of $f(A)$ has no multiple roots. Say $g(t)=\prod_{i=1}^n (t-r_i)\in\mathbb C[t]$, with $r_i$ distinct. And $g(f(A))=0$. In order to prove $A$ is diagonalizable in $\mathbb C$, we need to find a polynomial $p(t)\in\mathbb C[t]$ with no multiple roots such that $A$ is annihilated by $p(t)$. We know that $p(t)|g(f(t))$. Now the problem is how to use the fact that $f'(A)$ is invertible?