I want to prove:
$B$ is similar to $A \Leftrightarrow m_A(x) = m_B(x)$ and $P_A(x) = P_B(x)$, where $m,P$ are the minimal and characteristic polynomial, respectively.
"$\Rightarrow$" Let $A$ to be similar to $B$, then they have the same rational canonical form. On the other hand, the characteristic polynomial is the product of the invariant factors, but the invariant factors of an $n \times n$ matrix over a field $F$ are the invariant factors of its canonical form. Since $A,B$ have the same rational canonical form, then the characteristic polynomials are the same, hence: $P_A(x) = P_B(x)$, but the minimal polynomial is the largest invariant factor, so the minimal polynomials are the same and every other invariant factor divides the minimal polynomial, hence: $m_A(x) = m_B(x)$. (This comes from the fact that similar matrices have the same determinant)
"$\Leftarrow$" Let $A, B \in M_3(F)$ with the property that they have the same characteristic and minimal polynomial, that is: $P_A(x) = P_B(x) = f(x),$ $m_A(x) = m_B(x) = g(x).$ we want to prove that $A$ and $B$ are similar. First, recall that since we have a $3 \times 3$ matrix, this implies that the characteristic polynomial will have degree $3$, $g | f$ and every irreducible factor of $f(x)$ appears in $g(x)$. Moreover the degree of $g(x)$ is at most $3$. To prove similarity, it is enough to prove that they have the same set of invariant factors, which implies that the companion matrices will be the same.
- $\deg(g(x)) = 3$ If the degree of $g(x)$ is $3$, basically we cannot do a lot, so, we have that: $f(x) = g(x)$, so in this case the minimal polynomial is just $f(x)$ which implies that they are similar.
- $\deg(g(x)) = 2$ Notice that $f(x) = (x-a)g(x)$ for some $a \in F$ and $(x-a)$ is irreducible. On the other hand, every irreducible factor of the characteristic polynomial must appear in $g(x)$, which implies that: $g(x) = (x-a)(x-b)$ for some $b \in F$ and $f(x) = (x-a)^2 (x-b)$. Again, in this case the set of invariant factors is given by $\{(x-a),(x-a)(x-b)\}$ Then, they share the same invariant factors, so the companion matrices are the same, hence there are similar.
- $\deg(g(x)) = 1$ clearly, we have that: $g(x) = (x-a)$ for some $a \in F$. Then, the only possibility is that the invariant factors have the following form: $$\{(x-a),(x-a),(x-a)\}$$ Then, the matrices, $A,B$ have the same set of invariant factors and the same companion matrix, which implies that they are similar