Let $A$ be a square matrix of order $n$ such that $|A + I| = |A − 3I| = 0$ and also $\operatorname{rank}(A)= 2$. I need to find characteristic polynomial of $A$ and have prove that $A$ is diagonalizable.
I thought of using the characteristic polynomial equation $|\lambda I - A| = 0$, and for prove that $A$ is diagonalizable using the $P^{-1}AP$ and proving that $A$ is similar to diagonal matrix The rank information gives me that there is only $2$ linearly independent rows, so if I use Gauss–Jordan elimination it will remain only $2$ rows that are not zeroes.
Let $n$ be the size of your square matrix, and $a,b$ be the respective dimensions of the eigenspaces corresponding to the eigenvalues $-1$ and $3$. Then, $$a,b\ge1\quad\text{and}\quad a+b\le\operatorname{rank}(A)=2$$ hence $$a=b=1.$$ Since moreover $\dim\ker A=n-2,$ $A$ is similar to $\operatorname{diag}(-1,3,0,0,\dots,0)$ and its characteristic polynomial is $(X+1)(X-3)X^{n-2}$.