If two matrices have same characteristic polynomial, then if square root for one exists, it also exists for the other one. This is True/False question from the recent exam.
Statement: Suppose $A$ and $B$ are two elements of $M_n(\mathbb{R})$ such that their characteristic polynomials are equal. If $A=C^2$ for some $C\in M_n(\mathbb{R})$, then $B=D^2$ for some $D\in M_n(\mathbb{R})$.
I haven't reach the conclusion yet. But here's my thought. Since $A=C^2$, eigenvalues of $A$ are non-negative. Since $C_A(x)=C_B(x)$, eigenvalues of $A$ and $B$ are same, which means $B$ also have non-negative eigenvalues. But will this guarantee square root for $B$?
 A: This should be false. As an easy example, take a $2\times2$-Jordan block with Eigenvalue $0$. This matrix does not have a square root, but it has the same characteristic polynomial as the zero-matrix which obviuosly has a square root.
A: Consider the two matrices
$$ A = \begin{pmatrix} 0 & 0 \\ 0 & 0  \end{pmatrix}
B = \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix} $$
they have the same characteristic polynomials,$A$ has a square root, but $B$ doesn't have a square root. $$ $$
Edit:this is too long for a comment:
@Believer :for the first question,there is a general fact in Linear algebra if two linear $X,Y$ commute ,$E$ is an invariant subspace of $X$, (i.e $XE\subset E$),then $YE$ is an invariant subspace of $X$(i.e $X(YE)\subset YE$).Now if $B=D^{2}$,then $B$ and $D$ commute (bacause $B$ is a polynomial in $B$),since $<e_{1}>$ is the only (nontrivial)invariant subspace of $B$,$e_{1}$ must be an eigenvector of $D$,in particular $D$ must be upper triangular,with both diagonal values equal zero,but u can check that in thi scase $D^{2}=0$,so it cannot be equal to $B$
an easier way to see this is that if $D^{2}=B$,then $D$ is nilpotent,but we know that index of nilpotency is always lower or equal to the dimension, so again $D^{2}=0$,So $B$ doesn't have a square root.
