Solution (source code)

= Solution

A <composition series> is a finite chain $1=G_0\lhd G_1\lhd\cdots\lhd G_r=G$ in which each inclusion is proper, each <subgroup> is normal in the next, and every quotient $G_i/G_{i-1}$ is a nontrivial <simple group>. These quotients are the <composition factors>.

For a finite group, use induction on its order. The trivial group has the empty series. Otherwise choose a maximal proper <normal subgroup> $N$; such a <subgroup> exists because there are finitely many subgroups and $1$ is proper. The correspondence theorem says normal subgroups of $G/N$ correspond to normal subgroups of $G$ containing $N$, so maximality makes $G/N$ simple. Inductively construct a <composition series> of the smaller group $N$ and append $G$. This proves existence.

A nonabelian example with abelian factors is
$$
\boxed{1\lhd A_3\lhd S_3,\qquad\text{factors }C_3,C_2.}
$$
Both factors are simple because their orders are prime.