I need to show an equivalence relation on $ℕ$ defined as follows:
$x$ ~ $y$ ⇔ $x \times y$ is a square
Reflexivity: $x \times x$ is a square, so $x$ ~ $x$, so ~ is reflexive
Symmetry: $x$ ~ $y$ implies $y$ ~ $x$, $x\times y$ is a square, so is $y \times x$
But for transitivity I need to show that if $xy$ and $yz$ are both squares, then $xz$ is also a square.
So I did this:
$xy = a^2$ and $yz = b^2$, then $xz = \frac{a^2\times b^2}{y^2}$ and $xz = (\frac{ab}{y})^2$
But I don't think this works because there is a fraction. How else can I show that $xz$ is a square?
$$ xz y^2 = a^2 b^2 $$
So we know $a^2 b^2$ is divisible by $y^2$. In other words, $\dfrac{ab}{y}$ is an integer. So your solution is correct.