I'm having trouble understanding a passage from the proof of Corollary 3.37 in Hatcher's Algebraic Topology, namely the fact that the universal coefficient theorem implies $$ \mathrm{rank}\,H^k(M;\mathbb{Z}) = \mathrm{rank}\,H_k(M;\mathbb{Z}). $$
I've been looking for hints for a while, but I couldn't find what I need. The following attempt to a solution is what I eventually came up with, but I'm pretty sure there must be a much easier way to go.
Here goes: the UCT for cohomology allows me to say that $$ \mathrm{rank}\,H^k(M;\mathbb{Z}) = \mathrm{rank}\,\mathrm{Hom}(H_k(M;\mathbb{Z}),\mathbb{Z}) + \mathrm{rank}\,\mathrm{Ext}(H_{k-1}(M;\mathbb{Z}),\mathbb{Z}); $$
now, the group of homomorphisms from a f.g. abelian group to $ \mathbb{Z} $ is in turn a f.g. abelian group with the same rank, so that $$ \mathrm{rank}\,\mathrm{Hom}(H_k(M;\mathbb{Z}),\mathbb{Z}) = \mathrm{rank}\,H_k(M;\mathbb{Z}), $$
which leaves me with the issue of proving that $ \mathrm{rank}\,\mathrm{Ext}(H_{k-1}(M;\mathbb{Z}),\mathbb{Z}) = 0 $.
So far I've been unable to prove this last step.
Is my reasoning correct? Is there an easier way to go? Thank you in advance for your help.
Every f.g. abelian group is the direct sum of finitely many finite cyclic groups and a f.g. torsion-free (hence free) abelian group. $\mathrm{Ext}_\mathbb{Z}^1 (-, \mathbb{Z})$ preserves finite direct sums, so it suffices to show that $\mathrm{Ext}_\mathbb{Z}^1 (M, \mathbb{Z})$ is a finite group if $M$ is a finite cyclic group.
In fact, for all positive integers $m$, $$\mathrm{Ext}_\mathbb{Z}^1 (\mathbb{Z} / m \mathbb{Z}, \mathbb{Z}) \cong \mathbb{Z} / m \mathbb{Z}$$ as may be verified by direct calculation. This proves the claim.