let $T$ be a linear operator for a finite dimensional vector space $V$.
Let :
$m(t)$ be the minimal polynomial of $T$
$f(t)$ be any polynomial.
$g(t)$ be the $gcd(f(t),m(t))$
How do I prove that $ker(f(T)) = ker(g(T))$. It seems like primary decomposition theorem won't work since they are not necessarily coprime.
I'm thinking about taking $f$ and change it into powers of its irreducible factors, but I'm not sure where to go from there
Let $W=g[T](V)$ be the image subspace of the operator $g[T]$, which is clearly a $T$-stable subspace of$~V$. Let $\tilde g:V\to W$ be the surjective map defined by $g[T]$ (i.e., $g[T]$ is $\tilde g$ followed by the embedding $W\hookrightarrow V$). Now for any polynomial $P$ that is a multiple of $g$, the operator $P[T]$ on$~V$ similarly gives rise to a map $V\to W$, which can in fact be decomposed as $\tilde g$ followed by $Q[T_W]$, where $Q$ is the quotient polynomial $P/g$, and $T_W$ is the operator on the subspace$~W$ defined by$~T$ (by restriction).
Now put $q=m/g$ and $h=f/g$, which quotients are relatively prime by the definition of $g=\gcd(f,m)$. Since $m[T]=0$ on $V$ and $\tilde g$ is surjective one has $q[T_W]=0$ on $W$. It follows that $h[T_W]$ is an invertible operator on$~W$ (using a Bezout relation $1=rq+sh$, its inverse is $s[T_W]$). Therefore $\ker(f[T])=\ker(h[T_W]\circ\tilde g)=\ker(\tilde g)=\ker(g[T])$ as desired.
Note that the argument does not use that $m$ is the minimal polynomial, just that it annihilates $T$. What one gets in addition when $m$ is the minimal polynomial, is that $g$ (being a divisor of$~m$) is the lowest degree monic polynomial for which $\ker(g[T])$ coincides with $\ker(f[T])$. Indeed all monic divisors$~d$ of the minimal polynomial $m$ have distinct subspaces as $\ker(d[T])$, with inclusion among them according to the divisibility relations between those divisors. The statement proved shows that this precisely gives the complete set of subspaces that occur as $\ker(P[T])$ for any polynomial$~P$.