Proof (finite p-group has subgroup of all prime power orders)

Induct on $n$. The cases $n=0$ and $n=1$ are obvious.

Suppose $n>1$. If $k=0$, then take $\set{e}\leq G$. So assume $k\geq 1$.

Since $Z(G)$ is non-trivial, let $x\in Z(G) \setminus \set{e}$. Note that $\ord(x) = p^m$ for some $m\in \N$ (by Lagrange), and by replacing $x$ with $x^{p^{m-1}} \in Z(G)$, we can assume $\ord(x) = p$.

The subgroup $\langle x\rangle$ generated by $x$ has order $p$, and is normal in $G$ since $x$ is central. Therefore $G/\langle x\rangle$ is a quotient group with order $p^{n-1}$.

Apply the inductive hypothesis to find a subgroup $L\leq G/\langle x\rangle$ of order $p^{k-1}$. By subgroup correspondence, $L = K/\langle x\rangle$ for some $K$ satisfying $\langle x\rangle \leq K\leq G$. Then $K$ has order $p^k$.