Prove or disprove : if $x|y^2 $then $x|y$ How can I prove such statement?
I think that if $x|y^2$ then $x|(y*y)$ so $x|y$ or $x|y$ which means that in any case $x|y$. Am I correct?
I ask this question as such template because I think that it doesn't matter which $x$ or $y$ represents.
However, the original question is: if $6|n^2$ then $6|n$ and if $12|n^2$ then $12|n$.

The claim $x \mid y^2 \implies x \mid y$ is clearly false. Take $x = y^2 > 1$ a perfect square and see for yourself. What is true is: $$\begin{cases} x \mid yz \\ \gcd(x,y)=1\end{cases} \implies x \mid z.$$
Having this in mind, if $\gcd(x,y)=1$, and taking $y = z$...
