[step:Show that bracketing an element of $I^\perp$ by an element of $\mathfrak g$ stays orthogonal to $I$]
Let $x \in I^\perp$ and let $g \in \mathfrak g$. Define
\begin{align*}
y := [g,x] \in \mathfrak g.
\end{align*}
To prove $y \in I^\perp$, let $i \in I$ be arbitrary. By symmetry of $B$, followed by invariance of $B$ applied to the triple $(x,i,g)$, we have
\begin{align*}
B(y,i)
&= B([g,x],i) \\
&= B(i,[g,x]) \\
&= B([i,g],x) \\
&= B(x,[i,g]).
\end{align*}
Since $I \trianglelefteq \mathfrak g$ and $i \in I$, $g \in \mathfrak g$, the ideal property gives $[i,g] \in I$. Because $x \in I^\perp$, it follows that
\begin{align*}
B(x,[i,g])=0.
\end{align*}
Hence $B(y,i)=0$ for every $i \in I$, so $y=[g,x] \in I^\perp$.
[/step]