if $A$ and $B$ are two $n\times n$ matrices with same eigenvalues such that each eigenvalue has same algebraic and geometric multiplicity. Does $A$ and $B$ are similar?
If $A$ is diagnalizable then the claim is true. But does it true even when sum of geometric multiplicity is not $n$.
Please give me a hint to start with. If given a counter example, please help me to show they are not similar. Thanks
No, it's famously false. The usual counterexample is $A=\begin{pmatrix}0&1&0&0\\ 0&0&0&0\\ 0&0&0&1\\ 0&0&0&0\end{pmatrix}, B=\begin{pmatrix}0&1&0&0\\ 0&0&1&0\\ 0&0&0&0\\ 0&0&0&0\end{pmatrix}$ for both of which $0$ has algebraic multiplicity $4$ and geometric multiplicity $2$.
The result that holds is that two matrices $A, B\in \overline{\Bbb F}^{n\times n}$, where $\overline{\Bbb F}$ is an algebraically closed field, are similar if and only if, for all $\lambda \in \overline{\Bbb F}$ and for all $m\in\Bbb N$, $\dim\ker (A-\lambda id)^m=\dim\ker(B-\lambda id)^m$. This condition trivializes to yours as soon as $n\le 3$.
If $A,B\in \Bbb F^{n\times n}$ and $\Bbb F$ isn't algebraically closed, then the same result holds, in the sense that they are similar if and only if they are similar as matrices in $\overline{\Bbb F}^{n\times n}$ or, equivalently, if and only if $\dim\ker p(A)^m=\dim\ker p(B)^m$ for all $m\in\Bbb N$ and for all irreducible polynomials $p\in\Bbb F[x]$.