Let $x, ~y, ~ z$ be three integers such that $$x|y^2 ~~\text{ and } ~~ y|z^2.$$ Then prove or disprove: $x$ divides $z^2$.
My attempt: There exist integers $k$ and $l$ such that $$y^2=kx~~\text{ and } ~~ z^2= ly.$$ Then we have $~ x| z^4$ but not $z^2$ also I am unable to find the counterexample. Please help me to solve this.