No, that's false. You didn't say that $f$ is a homomorphism, but the answer is still no if we require this.

Let $G = {\bf Z} \times C_2 \times C_3 \times C_5 \times \cdots$ be the product of the infinite cyclic group and the cyclic groups of all prime orders. Let $H = C_2 \times C_3 \times C_5 \times \cdots$ and let $f: G \to H$ be the obvious homomorphism with kernel ${\bf Z}$. Let $Y$ be the subgroup of $G$ generated by the element $(1, 1, 1, \ldots)$. It is a discrete infinite cyclic subgroup, but its image in $H$ is not discrete (in fact, it is dense in $H$).