Solution (source code)

= Solution

If $x\in\mathfrak g_\alpha$, $y\in\mathfrak g_\beta$ and $h\in\mathfrak h$, invariance of the <Killing form> gives
$$
0=B([h,x],y)+B(x,[h,y])=(\alpha(h)+\beta(h))B(x,y).
$$
Unless $\alpha+\beta=0$, some $h$ makes its coefficient nonzero, so the two <root spaces> are orthogonal. Similarly $B(\mathfrak h,\mathfrak g_\alpha)=0$ for every <root>: choose $h$ with $\alpha(h)\ne0$ and use that $\mathfrak h$ is abelian.

Now take nonzero $x\in\mathfrak g_\alpha$. Nondegeneracy on $\mathfrak g$ supplies some element pairing nontrivially with $x$. Its <root-space decomposition> shows that only its $\mathfrak g_{-\alpha}$ component can contribute. Thus the pairing between opposite <root spaces> is nonzero, and indeed nondegenerate. Therefore
$$
\boxed{B(\mathfrak g_\alpha,\mathfrak g_\beta)\ne0\quad\Longleftrightarrow\quad\beta=-\alpha.}
$$
Here nonzero means the bilinear pairing is not identically zero, not that every pair of vectors has a nonzero value.

If $h_0\in\mathfrak h$ is orthogonal to all of $\mathfrak h$, it is also orthogonal to every <root space>, by the preceding orthogonality. It is therefore orthogonal to all of $\mathfrak g$, forcing $h_0=0$. Hence \b[$B|_{\mathfrak h}$ is nondegenerate].