[proofplan]
We prove that every invariant subspace has an invariant complement, and then complete reducibility follows by induction on the dimension of the representation space. Given a short exact sequence of $\mathfrak g$-modules $0 \to W \to V \to Q \to 0$, choose an arbitrary linear section $s: Q \to V$ and measure its failure to be $\mathfrak g$-equivariant by a $1$-cocycle with values in $\operatorname{Hom}(Q,W)$. Whitehead's First Lemma kills this cocycle because $\mathfrak g$ is finite-dimensional semisimple over a field of characteristic $0$ and all modules in sight are finite-dimensional. Correcting the section by the resulting [linear map](/page/Linear%20Map) produces a $\mathfrak g$-equivariant section, whose image is the desired invariant complement.
[/proofplan]
[step:Reduce complete reducibility to invariant complements]
Let $k$ denote the ground field, and let
\begin{align*}
\rho: \mathfrak g &\to \mathfrak{gl}(V)
\end{align*}
be a finite-dimensional representation of $\mathfrak g$ on a finite-dimensional $k$-[vector space](/page/Vector%20Space) $V$. We regard $V$ as a $\mathfrak g$-module by writing $xv := \rho(x)(v)$ for $x \in \mathfrak g$ and $v \in V$.
It is enough to prove that every $\mathfrak g$-submodule $W \subset V$ has a $\mathfrak g$-submodule complement $U \subset V$, meaning
\begin{align*}
V = W \oplus U.
\end{align*}
Indeed, once this is known, induction on $\dim_k V$ gives a decomposition into irreducible submodules: the cases $\dim_k V = 0$ and irreducible $V$ are immediate, while a reducible nonzero $V$ has a proper nonzero submodule $W$, a complement $U$, and both $W$ and $U$ have smaller dimension than $V$.
[/step]
[step:Encode an arbitrary splitting by a cohomological defect]
Let $W \subset V$ be a $\mathfrak g$-submodule. Define the quotient $\mathfrak g$-module
\begin{align*}
Q := V / W,
\end{align*}
with quotient map $\pi: V \to Q$ and action $x(v+W) := xv + W$. This action is well-defined because $W$ is $\mathfrak g$-invariant.
Choose a $k$-linear section
\begin{align*}
s: Q &\to V
\end{align*}
of $\pi$, so $\pi \circ s = \operatorname{id}_Q$. Define the finite-dimensional $\mathfrak g$-module
\begin{align*}
E := \operatorname{Hom}_k(Q,W),
\end{align*}
with action
\begin{align*}
(xA)(q) := x(A(q)) - A(xq)
\end{align*}
for $x \in \mathfrak g$, $A \in E$, and $q \in Q$. Define
\begin{align*}
c: \mathfrak g &\to E \\
x &\mapsto c(x),
\end{align*}
where
\begin{align*}
c(x)(q) := xs(q) - s(xq).
\end{align*}
For every $x \in \mathfrak g$ and $q \in Q$,
\begin{align*}
\pi(c(x)(q)) = xq - xq = 0,
\end{align*}
so $c(x)(q) \in W$ and $c$ is well-defined as a map into $E$.
[guided]
The section $s: Q \to V$ is only a linear splitting of the quotient map; it need not respect the $\mathfrak g$-action. The expression
\begin{align*}
c(x)(q) := xs(q) - s(xq)
\end{align*}
measures exactly this failure. If $s$ were $\mathfrak g$-equivariant, then $xs(q) = s(xq)$ for all $x \in \mathfrak g$ and $q \in Q$, so $c$ would vanish.
We must first check that $c(x)(q)$ really lies in $W$. Since $\pi: V \to Q$ is the quotient map and $\pi \circ s = \operatorname{id}_Q$, we compute
\begin{align*}
\pi(c(x)(q)) = \pi(xs(q)) - \pi(s(xq)) = x\pi(s(q)) - xq = xq - xq = 0.
\end{align*}
Thus $c(x)(q) \in \ker \pi = W$. Therefore $c(x)$ is an element of $E = \operatorname{Hom}_k(Q,W)$, and $c: \mathfrak g \to E$ is a well-defined $k$-linear map.
[/guided]
[/step]
[step:Verify that the defect is a $1$-cocycle]
We claim that $c$ is a Lie algebra $1$-cocycle, meaning
\begin{align*}
c([x,y]) = x c(y) - y c(x)
\end{align*}
in $E$ for all $x,y \in \mathfrak g$. Evaluating both sides at $q \in Q$ gives
\begin{align*}
(xc(y) - yc(x))(q)
&= x\bigl(ys(q) - s(yq)\bigr) - c(y)(xq) - y\bigl(xs(q) - s(xq)\bigr) + c(x)(yq) \\
&= xys(q) - xs(yq) - \bigl(ys(xq) - s(yxq)\bigr) \\
&\quad - yxs(q) + ys(xq) + \bigl(xs(yq) - s(xyq)\bigr) \\
&= [x,y]s(q) - s([x,y]q) \\
&= c([x,y])(q).
\end{align*}
Thus $c \in Z^1(\mathfrak g,E)$.
[guided]
The cocycle identity is the algebraic compatibility condition forced by the Lie bracket. We verify it directly from the definitions, using the action of $\mathfrak g$ on $E = \operatorname{Hom}_k(Q,W)$:
\begin{align*}
(xA)(q) = x(A(q)) - A(xq).
\end{align*}
For $x,y \in \mathfrak g$ and $q \in Q$, this gives
\begin{align*}
(xc(y))(q) &= x(c(y)(q)) - c(y)(xq), \\
(yc(x))(q) &= y(c(x)(q)) - c(x)(yq).
\end{align*}
Substituting $c(y)(q) = ys(q) - s(yq)$ and $c(x)(q) = xs(q) - s(xq)$, we obtain
\begin{align*}
(xc(y) - yc(x))(q)
&= x\bigl(ys(q) - s(yq)\bigr) - \bigl(ys(xq) - s(yxq)\bigr) \\
&\quad - y\bigl(xs(q) - s(xq)\bigr) + \bigl(xs(yq) - s(xyq)\bigr) \\
&= xys(q) - yxs(q) + s(yxq) - s(xyq) \\
&= [x,y]s(q) - s([x,y]q) \\
&= c([x,y])(q).
\end{align*}
Since this holds for every $q \in Q$, the equality holds in $E$. Hence $c$ is a $1$-cocycle.
[/guided]
[/step]
[step:Apply Whitehead's First Lemma to correct the splitting]
The module $E = \operatorname{Hom}_k(Q,W)$ is finite-dimensional because $Q$ and $W$ are finite-dimensional. Since $\mathfrak g$ is finite-dimensional semisimple over a field of characteristic $0$, [Whitehead's First Lemma](/page/Whitehead%20First%20Lemma) applies and gives
\begin{align*}
H^1(\mathfrak g,E) = 0.
\end{align*}
Because $c \in Z^1(\mathfrak g,E)$, there exists $A \in E$ such that
\begin{align*}
c(x) = xA
\end{align*}
for every $x \in \mathfrak g$. Define the corrected section
\begin{align*}
s_0: Q &\to V \\
q &\mapsto s(q) - A(q).
\end{align*}
Here $A(q) \in W \subset V$, so $s_0$ is a well-defined $k$-linear map. Also
\begin{align*}
\pi(s_0(q)) = \pi(s(q)) - \pi(A(q)) = q,
\end{align*}
so $s_0$ is still a section of $\pi$.
For $x \in \mathfrak g$ and $q \in Q$,
\begin{align*}
xs_0(q) - s_0(xq)
&= xs(q) - xA(q) - s(xq) + A(xq) \\
&= c(x)(q) - \bigl(xA(q) - A(xq)\bigr) \\
&= c(x)(q) - (xA)(q) \\
&= 0.
\end{align*}
Thus $s_0$ is $\mathfrak g$-equivariant.
[guided]
Now the hypotheses of Whitehead's First Lemma are exactly the hypotheses of the theorem plus finite-dimensionality of the auxiliary module. The Lie algebra $\mathfrak g$ is finite-dimensional, semisimple, and defined over a field of characteristic $0$ by assumption. The module $E = \operatorname{Hom}_k(Q,W)$ is finite-dimensional because $V$ is finite-dimensional and both $W$ and $Q = V/W$ are finite-dimensional. Therefore [Whitehead's First Lemma](/page/Whitehead%20First%20Lemma) applies to the $\mathfrak g$-module $E$ and yields
\begin{align*}
H^1(\mathfrak g,E) = 0.
\end{align*}
The vanishing of $H^1$ means that every $1$-cocycle is a $1$-coboundary. Since we proved $c \in Z^1(\mathfrak g,E)$, there is an element $A \in E$ satisfying
\begin{align*}
c(x) = xA
\end{align*}
for all $x \in \mathfrak g$, where the action on $E$ is
\begin{align*}
(xA)(q) = x(A(q)) - A(xq).
\end{align*}
We use $A$ to remove the defect of equivariance. Define
\begin{align*}
s_0: Q &\to V \\
q &\mapsto s(q) - A(q).
\end{align*}
This is well-defined because $A(q) \in W$ and $W \subset V$. It remains a section because $\pi(A(q)) = 0$:
\begin{align*}
\pi(s_0(q)) = \pi(s(q)) - \pi(A(q)) = q.
\end{align*}
Finally, we check equivariance directly:
\begin{align*}
xs_0(q) - s_0(xq)
&= xs(q) - xA(q) - s(xq) + A(xq) \\
&= c(x)(q) - \bigl(xA(q) - A(xq)\bigr) \\
&= c(x)(q) - (xA)(q) \\
&= 0.
\end{align*}
Thus $xs_0(q) = s_0(xq)$ for all $x \in \mathfrak g$ and $q \in Q$, so $s_0$ is a $\mathfrak g$-module homomorphism.
[/guided]
[/step]
[step:Take the image of the corrected section as the invariant complement]
Define
\begin{align*}
U := s_0(Q) \subset V.
\end{align*}
Since $s_0$ is $\mathfrak g$-equivariant, $U$ is a $\mathfrak g$-submodule of $V$. Since $\pi \circ s_0 = \operatorname{id}_Q$, the restriction $\pi|_U: U \to Q$ is an isomorphism. Hence $U \cap W = \{0\}$ and every $v \in V$ decomposes as
\begin{align*}
v = \bigl(v - s_0(\pi(v))\bigr) + s_0(\pi(v)),
\end{align*}
with $v - s_0(\pi(v)) \in W$ and $s_0(\pi(v)) \in U$. Therefore
\begin{align*}
V = W \oplus U.
\end{align*}
By the reduction step, every finite-dimensional representation of $\mathfrak g$ is completely reducible.
[/step]