I am facing a problem about showing the proposition above, where the language $\mathscr{L}$ is the language of abelian groups. I am thinking that $\mathbb{Z}$ has a generator $1$ and therefore $\mathbb{Z}\vDash \exists x \forall y (\exists n, y=nx)$, while the sentence is false in model $\mathbb{Z}^2$. However, $n$ is not in the language and I am confused if this idea make sense.
Thank you all!
The sentence involving a generator is not first-order, as you suspect. In fact, there is no first-order way to capture the property of being cyclic. More precisely, cyclic groups do not form an elementary class.
So, here is a hint: Consider remainders mod $n$ in your groups.