Solution (source code)

= Solution

For $x\in\ker(\alpha-\lambda I)$, commutation gives
$$
(\alpha-\lambda I)\beta x=\beta(\alpha-\lambda I)x=0.
$$
Thus each <eigenspace> of $\alpha$ is an <invariant subspace> for $\beta$.

If $\alpha=\beta^2$, the two <endomorphisms> commute. The $n$ distinct real <eigenvalues> of $\alpha$ have one-dimensional real <eigenspaces>, since their direct sum is the $n$-dimensional <vector space>. Take a nonzero real <eigenvector> $x_i$. Its <eigenspace> is invariant under $\beta$, so $\beta x_i=c_ix_i$ for a real scalar $c_i$. Squaring gives
$$
\lambda_i x_i=\alpha x_i=\beta^2x_i=c_i^2x_i,\qquad \boxed{\lambda_i=c_i^2\geq0.}
$$
The simple-spectrum hypothesis is essential: the real $90$-degree <rotation matrix> squares to $-I$ in dimension two, whose negative <eigenvalue> has a two-dimensional <eigenspace>.