Let $A$ and $B$ be real square matrices of the same size. Is it true that $$\det(A^2+B^2)\geq0\,?$$
If $AB=BA$ then the answer is positive: $$\det(A^2+B^2)=\det(A+iB)\det(A-iB)=\det(A+iB)\overline{\det(A+iB)}\geq0.$$
Let $A$ and $B$ be real square matrices of the same size. Is it true that $$\det(A^2+B^2)\geq0\,?$$
If $AB=BA$ then the answer is positive: $$\det(A^2+B^2)=\det(A+iB)\det(A-iB)=\det(A+iB)\overline{\det(A+iB)}\geq0.$$
If $A= \left( \begin{matrix} 1 &1 \\ 0 &1 \end{matrix} \right)$ and $B=\left( \begin{matrix} 1&0 \\ n&1 \end{matrix} \right)$, then $\det(A^2+B^2)=4(1-n)$.
The ideas in Seirios' answer and Jyrki Lahtonen's (now deleted) answer can be generalised to the following result:
Let $n\ge2$ and $A\in M_n(\mathbb{C})$. Then $\det(A^2+B^2)\ge0$ for all $B\in M_n(\mathbb{R})$ if and only if $A^2$ is a nonnegative scalar multiple of $I_n$.
Proof.
("$\Leftarrow$") Suppose $A^2=pI$ for some $p\ge0$. Since nonreal eigenvalues of $B$ occur in conjugate pairs and the squares of the real eigenvalues of $B$ are nonnegative, it follows that $\det(A^2+B^2)\ge0$.
("$\Rightarrow$") We first show that $A^2$ is real. Let $C=A^2=(c_{ij})$ and $B^2=\operatorname{diag}(0,\lambda,\lambda,\ldots,\lambda)$, where $\lambda>0$. By the given condition, $\det(A^2+B^2)=c_{11}\lambda^{n-1}+o(\lambda^{n-1})\ge0$ for all sufficiently large $\lambda$. Hence $c_{11}$ must be real. Similarly, other entries of $C$ are real too, i.e. $A^2$ has to be real.
It remains to show that:
If $n\ge2$ and $A^2\in M_n(\mathbb{R})$ is not a nonnegative multiple of $I_n$, then there exists $B\in M_n(\mathbb{R})$ such that $\det(A^2+B^2)<0$.
Consider the case $n=2$ first. Let $R(\theta)=\pmatrix{\cos\theta&\sin\theta\\ -\sin\theta&\cos\theta}$. We may assume that $A^2$ is in its real Jordan form. There are four possibilities:
Now, if $n>2$, we may assume that some diagonal block $\widetilde{A}$ in the real Jordan form of $A$ has one of the above forms. Therefore, if $B$ is a block-diagonal matrix whose corresponding diagonal block to $\widetilde{A}$ is chosen as in the above and each of the other diagonal blocks is $1\times1$ and is equal to $\rho(A)+1$, then $\det(A^2+B^2)<0$. (The addition of $1$ to $\rho(A)$ is needed to guarantee that the determinant is nonzero and the sign of the determinant is solely modified by the diagonal block corresponding to $\widetilde{A}$.)