Suppose $A=\begin{pmatrix}λ&a\\0&λ\end{pmatrix},B=\begin{pmatrix}λ&b\\0&λ\end{pmatrix} \in \Bbb C^{2\times 2}$ with $m_A(x)=m_B(x)=(x-λ)^2$ $(1)$.
I'm asked to prove that $A,B$ are similar.
From $(1)$ we get that $ab\ne 0 \implies$ both $A$ and $B$ are not diagonalizable. Also, we can see that they have the same corresponding eigenvectors. How do I continue from this part?
Let $\{ e_1, e_2 \}$ denote the basis vectors with respect to which these matrices are written.
Try to show that, if we define a new basis, $\{ f_1 = a e_1, f_2 = e_2\}$, then in this new basis, the matrix for $A$ is $$ A = \left( \begin{array}{cc} \lambda & 1 \\ 0 & \lambda \end{array}\right).$$
Can you find another basis in which the matrix for $B$ takes the form $$ B = \left( \begin{array}{cc} \lambda & 1 \\ 0 & \lambda \end{array}\right)?$$
If so, then you've succeeded in showing that $A$ and $B$ are similar!
Finally, for $\{ f_1 = a e_1, f_2 = e_2 \}$ to actually be a basis, we need $f_1$ and $f_2$ to be linearly independent, i.e. we need $a \neq 0$. Otherwise none of this will work!
So you need to use the fact that the minimum polynomial is $(x - \lambda)^2$ (as opposed to $x - \lambda$) to show that $a$ cannot be zero - but you appear to have already done that!
By the way, ANY two-by-two matrix with minimal polynomial $(x- \lambda)^2$ has Jordan canonical form $\left( \begin{array}{cc} \lambda & 1 \\ 0 & \lambda \end{array} \right)$.