Let $R$ be a commutative ring with $1$ and suppose $q^2\mid p^2,$ for $p,q \in R$. Unless $R$ is a UFD, I don't believe I can conclude that $q\mid p,$ but I would like to know a concrete counterexample.
Does anyone know an example of such a ring, where there exist elements $p,q$ such that $q^2$ divides $p^2$ but $q$ does not divide $p$?
In $\mathbb{Z}/4$ take $q=0$ and $p=2$.
For an example of an integral domain, take $\mathbb{Z}[x,y]/(x y^2-4)$ and $p=y$, $q=2$.