Prove every element of $G$ has finite order.
To express your idea differently:
If $G$ has an element $a$ of infinite order, then the intersection of all nontrivial subgroups is trivial.
Indeed, this is true for $\mathbb Z$, which is isomorphic to $\langle a \rangle$.
Therefore, if the intersection of all nontrivial subgroups is nontrivial, then $G$ cannot have an element of infinite order and so all elements must have finite order.
Not completely true, but it is the idea precise that $y$ is in the group generated by $a$ so $y=a^n$. $y$ is also in the group generated by $a^{2n}$ so $y={a^{2n}}^m=a^{2nm}$, so $a^{2nm-n}=1$ contradiction