5.2:
The proof is by induction on n, with the inital case n=1 being trivial. Suppose n>1. Since G is a p-group, the center Z(G) is not trivial. Then Z(G) has an element of order p, which generates a subgroup H of order p. Since H is central, H is normal in G. Moreover, G/H is a group of order pn-1. Then, for every k satsifying 1 <= k <= n, G/H has a subgroup of order pk-1 by the inductive hypothesis. (The case k=1 is not covered by the inductive hypothesis, but in that case the trivial subgroup has order pk-1.) By the third isomorphism theorem, this subgroup has the form K/H, where K is a subgroup of G of order pk. This completes the inductive step.