Given the following matrix, I was asked to tell whether the matrix is the square of some matrix or not.
$$ \begin{pmatrix} 1 & 0 & 0\\ 0 & -1 & 0\\ 0 & 0 & -1 \end{pmatrix} $$
Since this matrix is diagonal, a square root is
$$ \begin{pmatrix} 1 & 0 & 0\\ 0 & i & 0\\ 0 & 0 & i \end{pmatrix} $$ Am I right?
You are right if the question was about matrices with complex coefficients, but wrong if it was about matrices with real coefficients. In the latter case, an answer would be$$\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}.$$