First assume that $A$ and $B$ are $p \times p$ matrices and that $\lambda_1,\ldots , \lambda_p$ are distinct eigenvalues of $A$ and $B$. I want to show that $A$ and $B$ are similar.
Here is my approach: The goal is to show that there is a nonsingular $p \times p$ matrix $P$ such that $B = P^{-1}A P$. We know the following is satisfied for each eigenvalue $$ A \textbf x_j = \lambda_j \textbf x _j \text { where } j = 1,\ldots,p$$ and $\textbf x_j$ are the eigenvectors. Since $A$ and $B$ share the same eigenvectors, $B$ must satisfy the following $$ B \textbf x_j = \lambda_j \textbf x _j \text { where } j = 1,\ldots,p$$ Thus we have $$ B \textbf x_j = A \textbf x_j$$ We can take the $\textbf x_j$ as the columns of the matrix $P$ and get $$BP=AP$$ we know that the columns of $P $ are linearly independent so the matrix must be non singular. Unfortunately this means that $$A=B$$ but this is not what we wanted to show. Am I on the right track? Is there an obvious mistake I am making?