I am getting conflicting answers depending on how I approach the problem and I don't understand why. Let $A=\begin{pmatrix}2&-5&7\\1&-2&0\\0&0&3 \end{pmatrix}$. If I go directly to the characteristic polynomial I get $\det(A-I\lambda)=\det\begin{pmatrix}2-\lambda&-5&7\\1&-2-\lambda&0\\0&0&3-\lambda \end{pmatrix}$ and then calculating the determinant I get that $\lambda_1=3, \lambda_{2,3}=\pm i$.
I then conclude that $A$ is not diagonalizable over $\mathbb{R}$ as we have non-real eigenvalues.
However if I put $A$ into an upper diagonal matrix I have that $A=\begin{pmatrix}2&-5&7\\0&0.5&-3.5\\0&0&3 \end{pmatrix}$
I then see the eigenvalues as the entries of our upper diagonal matrix, i.e. distinct and real. Then isn't this representation of $A$ diagonalizable? But $A$ hasn't changed. What am I misunderstanding?
Thanks
Your new matrix is equivalent to $A$, but not similar. The latter condition is stronger and required to preserve the Eigenvalues.