Although this theorem is invoked repeatedly, it can be difficult to track down a proof. Well - the proof is here.
If G is not finitely generated, it might not be the direct product or direct sum of cyclic groups. Consider the algebraic closure of the finite field Zp. Its multiplicative group is abelian, but not finitely generated. It has a cyclic subgroup of order p-1, contained in a cycle of order p2-1, contained in a cycle of order p4-1, and so on. This cannot be split into parallel cycles.
A (perhaps) simpler example is the rationals whose denominators are powers of 2. This forms a group under addition, which I will call G. Each cyclic subgroup is infinite. This follows from the fact that Q is an integral domain. So if G is the direct sum of cyclic subgroups then G is the direct sum of copies of Z, and G is a free abelian group. Let x be an element in a basis for G. Divide x by 2 and find another element of G. In a free group, one cannot cut a basis element in half. This is a contradiction, hence G is not the direct sum of cyclic subgroups.
Suppose a sum of elements xi, drawn from Hi, equals 0, the group identity. Take the shortest sum, i.e. the sum with the fewest terms. Now, minus the first element in the sum, say -x1, has order equal to some power of p, and is equal to the sum of the remaining elements.
-x1 = x3 + x5 + x9
Multiply through by pk, and the left side becomes 0. Since p is relatively prime to the order of x3, that term is nonzero in H3. The others are nonzero as well. This gives a shorter sum of elements that is equal to 0, and that is a contradiction. The subgroups Hi are disjoint, and H is equal to their direct product.
The order of H is n, and H lives in G, which also has order n, hence G is the direct product of its sylow subgroups. If we understand each Hi, we understand G.
If each Hi is cyclic, generated by xi, let x be the sum over xi. The order of x is now the least common multiple of the orders of xi. This is the least common multiple of all the prime powers in n, which is n. If each Hi is cyclic, then G is cyclic. Conversely, if G is not cyclic then some Hi is not cyclic.
What do the subgroups look like? Without loss of generality, concentrate on H1. If it has order p, it is Zp. End of story. Procede by induction on pk. Let J be a subgroup of order pk-1, which exists inside H1 by the first sylow theorem. By induction, J is one or more copies of cyclic groups, running in parallel, where each cycle is a power of p, and their product is pk-1. The quotient H1/J is cyclic, with order p. Let y be a cosrep that generates the quotient group. Now py is something in J. Suppose py = z with in one of the cycles of J. If z is divisible by p, say z = pv, replace y with y-v. Now py lands on 0 in this particular cycle, and is independent of that cycle. If v is not divisible by p, use v as the generator for that cycle, rather than 1. Since v is coprime to p, it works just as well. We're just renumbering the elements. Do this across all of J, and py might equal 1,1,1; for 3 of the parallel cycles in J. Arrange the cycles so the longest comes first (I think we need to do that). Let 1,1,1 generate the first cycle, and let 0,1,0 and 0,0,1 generate the other two cycles. They still run independently of one another, and the element y has made the first cycle longer, by a factor of p. Therefore H1 is, like J, one or more copies of cyclic groups, running in parallel. Make a similar assertion for each Hi, and this completely characterizes the finite abelian group G.