The question states that $R$ is a relation on $\mathbb{N}$ (excluding $0$) if and only if $xy = m^2$ with $m \in \mathbb{N}$. It asks to prove that it is an equivalence relation.
I showed that it is reflexive as $xx=x^2$ and we know that $x \in \mathbb{N}$.
I showed symmetry by using the fact that multiplication is commutative so $xy=yx$ thus if $xy$ is in the relation so is $yx$.
I'm having some trouble with showing that it is transitive. I know that to show if a relation is transitive then $(x,y) \in R \land(y,z) \in R \implies (x,z) \in R$.
How do i show this for this example?
If $x\sim y$ then $xy = n^2$ for some natural $n$; we also have $y \sim z \implies yz = m^2$. Putting this together gives
$$xz = \frac{(xy)(yz)}{y^2} = \frac{n^2m^2}{y^2} = \left(\frac{nm}{y}\right)^2$$
You just need to show that $\frac{nm}{y}$ is a natural number. Can you do that?