Finding possible minimal polynomials 
Let $\mathbf{A}$ be a square matrix such that
  $$\mathbf{A}^3-4\mathbf{A}^2+5\mathbf{A}-2\mathbf{I}=\mathbf{0}\quad---\quad(*)$$
  $(a)$ List all possible answers for the minimal polynomial of $\mathbf{A}$.
$(b)$ Find all complex $3\times 3$ matrices $\mathbf{A}$ that satisfies $(*)$.

My attempt
$(a)$
\begin{align}
&\mathbf{A}^3-4\mathbf{A}^2+5\mathbf{A}-2\mathbf{I}=(\mathbf{A-I})^2(\mathbf{A-2I)}=\mathbf{0}\\\\
\Rightarrow &\mathbf{A-I}=\mathbf{0}\\
\text{or}&(\mathbf{A-I})^2=\mathbf{0}\\
\text{or}&\mathbf{A-2I}=\mathbf{0}\\
\text{or}&(\mathbf{A-I})(\mathbf{A-2I})=\mathbf{0}\\
\text{or}&(\mathbf{A-I})^2(\mathbf{A-2I})=\mathbf{0}
\end{align}
$\therefore x-1,\,x-2,\,(x-1)^2,\,(x-1)(x-2),\,(x-1)^2(x-2)$ are possible minimal polynomials of $\mathbf{A}$.
$(b)$ For any complex $3\times 3$ invertible matrix $\mathbf{P}$,
$$\mathbf{A}=\mathbf{P}\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}\mathbf{P}^{-1}\,\text{or}\\\mathbf{P}\begin{pmatrix}2&0&0\\0&2&0\\0&0&2\end{pmatrix}\mathbf{P}^{-1}\,\text{or}\\\mathbf{P}\begin{pmatrix}1&1&0\\0&1&0\\0&0&1\end{pmatrix}\mathbf{P}^{-1}\,\text{or}\\\mathbf{P}\begin{pmatrix}1&0&0\\0&1&0\\0&0&2\end{pmatrix}\mathbf{P}^{-1}\,\text{or}\\\mathbf{P}\begin{pmatrix}1&1&0\\0&1&0\\0&0&2\end{pmatrix}\mathbf{P}^{-1}$$
I am not sure of my answers, any help would be appreciated.
 A: Question (a) does not mention the size of the matrix, so every unitary polynomial dividing the polynomial $X^3-4X^2+5X-2=(X-1)^2(X-2)$ can be the minimal polynomial of $A$ (for every unitary polynomial there is some matrix having it as minimal polynomial, for instance the companion matrix of the polynomial). Since there are irreducible factors with multiplicities $2,1$ the number of unitary divisors is $(2+1)(1+1)=6$ (as with prime factors of an integer, the multiplicity in a divisor can range from $0$ to its multiplicity$~m$ in the multiple, for $m+1$ values in all). The one unitary divisor that is missing from your list is$~1$. It can be the minimal polynomial of a linear operator$~\phi$ on a space$~V$, and therefore of its matrix, namely when $\phi^0=I_V=0_V$, and this happens if and only if $\dim(V)=0$; therefore the minimal polynomial of the unique $0\times0$ matrix is$~1$.
For question (b) a minimal polynomial$~1$ cannot occur, but all five others can. In general you need a space of dimension at least the degree of the minimal polynomial, which is OK here. Once you have an example of a linear operator with a given minimal polynomial having at least one root$~\lambda$, you can extend it to one of a higher dimension if necessary by taking a product with a complementary space on which your operator is defined to act by the scalar$~\lambda$, which will not change the minimal polynomial.
So you need at least $5$ similarity classes of matrices in (b). To see how many exactly, you need to consider the possible sets of Jordan blocks. The multiplicity of $X-\lambda$ in your chosen minimal polynomial must be the size of the largest Jordan block for$~\lambda$, so for minimal polynomials $(X-1)^2$ and $(X-1)^2(X-2)$ you need one Jordan block for $\lambda=1$ of size$~2$. The remaining size$~1$ Jordan block must (also) be for $\lambda=1$ in the former case (as per the indicated extension method), and for $\lambda=2$ in the latter case. The three remaining minimal polynomials have only simple factors, so they correspond to diagonalisable matrices (only trivial $1\times1$ Jordan blocks of the form $(\lambda)$). The two polynomials $X-\lambda$ of degree$~1$ only allow for the matrix $\lambda I_3$, both as Jordan normal form and as the matrix$~A$ itself. The remaining polynomial $(X-1)(X-2)$ gives a diagonal Jordan form with eigenvalues $1$ and $2$; each one occurs at least once, but there are two ways to choose the remaining third diagonal entry among $\{1,2\}$. All in all there are six similarity classes of matrices in the answer to (b) (two classes being reduced to a single matrix), whose representative Jordan normal forms you can now easily write down.
