Let $A$ and $B$ be finite abelian groups.
Suppose that for every natural number $m$, the number of elements of order $m$ in $A$ is equal to the number of elements of order $m$ in $B$.
Prove that $A$ and $B$ are isomorphic.
Idea
Given that these groups are finite, I think you have to use the primary decomposition theorem somehow.
This is not true in general. Take $A = \mathbb{Q}, B = \mathbb{Q} \times \mathbb{Q}.$ Even if you assume that the groups contains "some" elements of finite order, then also it is not true. Take $A = \mathbb{Q} \times \mathbb{Z}/m\mathbb{Z}, B = \mathbb{Q} \times \mathbb{Q} \times \mathbb{Z}/m\mathbb{Z}$ where $m > 1$ is an integer.
But if you choose $A$ and $B$ to be finite, then it is true. This follows from the structure theorem of finite abelian groups. Note also that it is not true even for finitely generated abelian groups which are not finite. Take $A = \mathbb{Z}^r, B = \mathbb{Z}^s, r\neq s.$
$\bf{EDIT:}$ Let $A$ and $B$ be two finite abelian groups. Then $A \cong \mathbb{Z}/d_1\mathbb{Z} \times \mathbb{Z}/d_2\mathbb{Z} \times \cdots \times \mathbb{Z}/d_r\mathbb{Z},$ for some $d_1, d_2, \cdots ,d_r \in \mathbb{Z}$ are prime powers (not necessarily distinct). Similarly $B \cong \mathbb{Z}/e_1\mathbb{Z} \times \mathbb{Z}/e_2\mathbb{Z} \times \cdots \times \mathbb{Z}/e_s\mathbb{Z},$ for some $e_1, e_2, \cdots , e_s \in \mathbb{Z}$ are prime powers (not necessarily distinct). The numbers $d_i$ and $e_j$ are uniquely determined by $A$ and $B$ respectively. So by the given condition, we must have $r = s, d_i = e_i, \forall i.$ This shows that $A$ and $B$ are isomorphic.