This is exercise 7 from "The Theory of Finite Groups" by Hans Kurzweil, page 49.
For every subgroup $H$ of a finite abelian group $ G$ there exist an endomorphism $\phi$ with $\text{Im}(\phi)=H$
I believe it can be tackled using the classification theorem of abelian groups, which states that every abelian group is a direct product of cyclic groups. However, I am unable to proceed further with the given information. I know that $G$ is a product of cyclic groups and $H$ and $G$ is a product of some of these factors.
Step 1. If $G$, $H$ are groups of relatively prime order (even non abelian) then every subgroup of $G\times H$ is a direct product of subgroups of $G$ and $H$.
Step 2. Given an abelian $p$-group $G$, it is isomorphic to product of cyclic $p$-groups. Then a subgroup of $G$ is isomorphic to direct product of subgroups of those cyclic groups (as you can see here: Subgroups of abelian $p$-groups). Note: unlike step 1 here we have only isomorphism.
Step 3. For cyclic group $\mathbb{Z}/p^n\mathbb{Z}$ its subgroups are simple: each is isomorphic to $\mathbb{Z}/p^m\mathbb{Z}$ for some $m\leq n$. Therefore there is an easy construction of an epimorphism $\mathbb{Z}/p^n\mathbb{Z}\to \mathbb{Z}/p^m\mathbb{Z}$.
Combine all the steps with direct product of homomorphisms and classification of finite abelian groups to obtain required homomorphism.