Let $x, y \in \mathbb{Z}$. If $x \mid y^{2}$ then $x \mid y$. One counter example would be to let $x = 16$ and $y = 4$. We know that $16 \mid 16$, but $16 \nmid 4$.
My question is what is wrong with the following proof. Lets show the contrapositive, $x \nmid y$, then $x \nmid y^2$.
$x \nmid y$ implies that $y = cx + 1$ where $c \in \mathbb{Z}$. Then $y^{2} = c^{2}x^{2} + 2cx + 1 = x(c^{2}x + 2c) + 1$ and we know that $c^{2}x + 2c$ is an integer. Since $y^{2}$ is in the same form as $y$, we can conclude that $x \nmid y$.