Square root of a matrix A is not a unique matrix, generally.
How to find all the square roots of a matrix, in particular the following matrix B:
$$ \begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix} $$
other than forming 9 equations in 9 variables as:
$$ \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix} $$
In particular, is there any square root of B that has all elements as real numbers.
In general there is no guarantee that a real matrix has a square root with real coefficients. In this case however you may find for e.g. $$M = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & \mp1 \\ 0 & \pm1 & 0 \end{bmatrix}$$
Now $M^2=(-M)^2=B$. This is easier to see if you consider the $B$ matrix as decomposed diagonally into identity matrix $I_1$ and $-I_2$. Now $-I_2$ can be considered a rotation by $\pi$, hence it has a real square root which is the rotation matrix by $\pi/2$.