Definition: Let $F$ be a field. An ideal in $F[x]$ is a subspace $M$ of $F[x]$ such that $f\cdot g\in M$, $\forall f\in F[x]$, $\forall g\in M$.
Let $A$ be an $n\times n$ matrix over a field $F$. Show that the set of all polynomials $f$ in $F[x]$ such that $f(A)=0$ is an ideal.
My attempt: $A\in M_{n}(F)$. We need to show $M=\{f\in F[x]\ |\ f(A)=0\}$ is ideal in $F[x]$. Since $\dim (M_n(F))=n^2$, we have $I,A,A^2,…,A^{n^2}$ is linearly dependent. So $\exists c_0,c_1,…,c_{n^2}\in F$ such that $c_j\neq 0$, for some $j$ and $\sum_{i=0}^nc_i\cdot A^i=0$. Let $h=\sum_{i=0}^nc_i\cdot x^i\in f[x]\setminus \{0\}$. Then $h(A)=0$. So $h\in M$. Thus $M\neq \emptyset$. Let $f,g\in M$ and $c\in F$. By theorem 2 section 4.2, $(c\cdot f+g)(A)=c\cdot f(A)+g(A)=0$. Thus $c\cdot f+g\in M$. Hence $M$ is subspace of $F[x]$. Let $f\in F[x]$ and $g\in M$. By theorem 2 section 4.2, $f\cdot g(A)=f(A)\cdot g(A)=f(A)\cdot 0=0$. Thus $f\cdot g\in M$. Is my proof correct?