Predicting if a $3 \times 3$ matrix has a real square root Here are a few $3 \times 3$ matrices
A)$$
\begin{pmatrix}   1&    0&    0\\
    0  & 1 &   0\\
    0&    0  &  1\end{pmatrix}$$B)$$
\begin{pmatrix}   1&    0&    0\\
    0  & 1 &   0\\
    0&    0  &  -1\end{pmatrix}$$C)$$
\begin{pmatrix}   1&    0&    0\\
    0  & -1 &   0\\
    0&    0  &  -1\end{pmatrix}$$D)$$
\begin{pmatrix}   -1&    0&    0\\
    0  & -1 &   0\\
    0&    0  &  -1\end{pmatrix}$$
How can say if these matrices are the square of a $3 \times 3$ matrix with real entries or not?

A necessary condition for a real matrix to have a real square root is to have a non-negative determinant.
Indeed, if $A=B^2$, then $\det(A)=\det(B)^2\geqslant 0$.
Method. If $A$ is diagonalizable and has positive eigenvalue, a square root can be found taking the square root of its eigenvalues, namely if $A=P\Lambda P^{-1}$, then $B=P\Lambda^{1/2}P^{-1}$ is a square root of $A$.
