$\frac{1}{x}-\frac{1}{y} = \frac{1}{z}, h = gcd(x,y,z)$. Prove that $hxyz$ and $h(y-x)$ both are perfect squares. This problem appeared multiple times in MSE -    
UK 1998, Show that $hxyz$ is a perfect square.
Let $x,y,z$ be positive integers such that $\frac{1}{x}-\frac{1}{y}=\frac{1}{z}$. Let $h=\gcd(x,y,z)$, Prove that $hxyz,h(y-x)$ are perfect squares 
They seem not to solve my problem. Also the posts are old enough. This problem appeared in UK MO 1998. I found this solution in the book "104 Number Theory Problems from USA Math Camp" written by Titu Andrescu - 

I don't understand the red boxed step. How we get
$c(b'-a') = a'b'g$ implies $g \mid c$?
why it cant occur that $g \mid (b'-a')$ and $a'b' \mid c$?
I don't understand from here till end.
Both of the linked question have answers with different approaches. But I want a solution which continues from here.
 A: Good job asking a specific question—it makes it very easy to provide useful comments! And indeed, this step of the proof is incorrect: when $a=6$, $b=15$, and $c=10$, we have $\frac16-\frac1{15} = \frac1{10}$ and $g=\gcd(a,b)=3$ does not divide $c$.
(By the way, in your comments, you say "why can't it occur that $g\mid (b'-a')$...?" I want to remind you that $g\mid c(b'-a')$ does not necessarily mean that $g\mid c$ or $g\mid(b'-a')$; it could be that $g$ is the product of some divisor of $c$ times some divisor of $b'-a'$.)
A: Actually I get the exact opposite as the text does.
As $\gcd(a,b,c) = 1$ and $\gcd(a,b) = g$ we know $\gcd(g,c) = 1$
So we have $c(b'-a') = a'b'g$ so $g|(b'-a')$  Furthermore we know $\gcd(a'-b',a') = \gcd(a'-b',b') = 1$ so $a'b'|c$.
So we have $\frac {c}{a'b'}(b'- a') = g$.  But $\gcd(g,c) =1$ so $\frac{c}{a'b'} = 1$ so $g = b'-a'$ (but that's not relevant) and $c = a'b'$ (and that is relevant).
So $hxyz = h^4abc = h^4(ga')(gb')(a'b') = (h^2ga'b')^2$.
=====
If I were to do it entirely on my own:
Let $h = \gcd(x,y,z); x = hx'; y= hy'; z = hz'$
$hxyz = h^4(x'y'z)$ and $h(y-x) = h^2(y'-x')$ so  $hxyz$ is a perfect square if and only if $x'y'z$ is and $h(y-x)$ is a perfect square if and only if $y'-x'$ is.  So  wolog we may assume $h= 1$.
$\frac 1z = \frac 1x - \frac 1y$
$\frac {xy}z = y -x$. Presumable $y \ne x$ if is did we'd have $z = 0$ and $hxyz = 0^2$ and $h(y-x) = 0$ is trivial.  So presume $y \ne x$
$z = \frac {xy}{y-x}$
So $y-x|xy$. 
Let $g=\gcd(x,y)$ and $x=gx';y=gy'$ and $\gcd(x',y') =1$. 
$y'-x'|gx'y'$.  If $p$ prime is a factor of $x'$ then $p\not \mid y'$ and $p|y'-x'$.  Likewise for any prime factor of $y'$.  So $\gcd(y' -x',x'y') = 1$ and $y'-x'|g$. Let $y'-x' = kg$.  And as $\gcd(y'-x', x'y') =1$ we know $\gcd(k, x'y') = 1$.
So $z = \frac {xy}{y-x} = \frac{gx'y'}{y'-x'} = \frac{x'y'}k$. But $\gcd(x'y',k) = 1$ so $k = 1$ and $y' - x' = g$
So that proves $y-x = g(y'-x') = g^2$ is a perfect square.
So $xyz = xy\frac{xy}{y-x} = xy\frac{xy}{g^2}=(\frac{xy}{g})^2 = (x'y)^2 = (xy')^2 = (gx'y')^2$ is a perfect square.
A: It suffices to prove $\,abc\,$ and $\,b\!-\!a\,$ are squares, by $\ hxyz = h^4abc,\,$ $\, h(z\!-\!y) = h^2(b\!-\!a)$
$$\begin{align}{\rm multiplying}\ \ \ \dfrac{1}{c}\ &=\ \dfrac{1}a\ -\ \dfrac{1}b\ \  \ {\rm by}\  \ \ g := (a,b)\\[0.7em]
{\rm yields}\ \ \ \dfrac{(a,b)}{c}\ &=\ \dfrac{1}{a'}\ -\ \dfrac{1}{b'}\ =\ \dfrac{b'-a'}{{a'b'}}\end{align}$$
Both fractions are reduced (i.e. in lowest terms) since  $\,{((a,b),c)}=1=(b'\!-a',a'b'),\,$ therefore they have equal numerator and denominator (wlog $\ge 0),\,$ hence
$$b'\!-a' = (a,b)=g\ \Rightarrow\ b\!-\!a = g(b'\!-\!a') = g^2$$
$$ a'b' = c\ \Rightarrow\ abc = g^2 a'b'c = g^2 c^2 = (gc)^2$$
Remark $\ $ Notice how much clearer the argument becomes when presented in fractional form. See this post on unique fractionization for more on the uniqueness of reduced fractions.
