[proofplan]
We first prove the divisibility assertion from Bézout's identity: since $\gcd(a,b)=1$, an integer linear combination of $a$ and $b$ equals $1$, and multiplying by $c$ expresses $c$ as a sum of two multiples of $a$. For the square-factor statement, we handle the zero case separately, then use unique prime factorization to compare prime exponents. Coprimality forces each prime to occur in at most one of $a$ and $b$, while the assumption that $ab$ is a square forces every exponent in the product to be even.
[/proofplan]
[step:Use Bézout's identity to express $c$ as a multiple of $a$]
Since the [greatest common divisor](/page/Greatest%20Common%20Divisor) satisfies $\gcd(a,b)=1$, [Bézout's identity](/page/Bezout%27s%20Identity) gives integers $u,v \in \mathbb{Z}$ such that
\begin{align*}
ua+vb=1.
\end{align*}
Multiplying this equality by $c$ gives
\begin{align*}
uac+vbc=c.
\end{align*}
The integer $uac$ is divisible by $a$. By the definition of [divisibility](/page/Divisibility), the hypothesis $a \mid bc$ gives an integer $k \in \mathbb{Z}$ such that $bc=ak$, and hence
\begin{align*}
vbc=vak.
\end{align*}
Thus $vbc$ is also divisible by $a$. Therefore
\begin{align*}
c=uac+vbc=a(uc+vk),
\end{align*}
with $uc+vk \in \mathbb{Z}$. Hence $a \mid c$.
[guided]
The hypothesis that the [greatest common divisor](/page/Greatest%20Common%20Divisor) satisfies $\gcd(a,b)=1$ is used through [Bézout's identity](/page/Bezout%27s%20Identity): there exist integers $u,v \in \mathbb{Z}$ satisfying
\begin{align*}
ua+vb=1.
\end{align*}
We want to prove that $a$ divides $c$, so we multiply this identity by $c$ in order to create an expression for $c$:
\begin{align*}
uac+vbc=c.
\end{align*}
Now we check divisibility term by term. The first term is
\begin{align*}
uac=a(uc),
\end{align*}
so it is divisible by $a$. For the second term, the definition of [divisibility](/page/Divisibility) applied to the hypothesis $a \mid bc$ means that there is an integer $k \in \mathbb{Z}$ such that
\begin{align*}
bc=ak.
\end{align*}
Multiplying by $v$ gives
\begin{align*}
vbc=vak=a(vk),
\end{align*}
so $vbc$ is also divisible by $a$. Adding the two multiples of $a$, we obtain
\begin{align*}
c=uac+vbc=a(uc+vk).
\end{align*}
Since $uc+vk \in \mathbb{Z}$, this is exactly the statement that $a \mid c$.
[/guided]
[/step]
[step:Separate the zero case in the square-factor statement]
Assume now that $a,b \in \mathbb{Z}$, $\gcd(a,b)=1$, and $ab=m^2$ for some $m \in \mathbb{Z}$. If $m=0$, then $ab=0$. Since $\gcd(a,b)=1$, one of $a,b$ is $0$ and the other is $1$ or $-1$. If $a=0$, choose $r=0$, choose $s=1$, choose $\varepsilon=1$, and choose $\delta=b$. If $b=0$, choose $s=0$, choose $r=1$, choose $\delta=1$, and choose $\varepsilon=a$. In both cases,
\begin{align*}
a=\varepsilon r^2,\qquad b=\delta s^2.
\end{align*}
Thus it remains to consider the case $m \neq 0$, so $a \neq 0$ and $b \neq 0$.
[guided]
We now prove the square-factor assertion. Assume $a,b \in \mathbb{Z}$, $\gcd(a,b)=1$, and that $ab$ is an integer square, so there exists $m \in \mathbb{Z}$ with
\begin{align*}
ab=m^2.
\end{align*}
The case $m=0$ must be handled before using prime factorization, because prime factorization is stated for nonzero integers. If $m=0$, then $ab=0$, so at least one of $a$ and $b$ is zero. Since $\gcd(a,b)=1$, the other integer must have absolute value $1$: if $a=0$, then $\gcd(0,b)=|b|=1$, and if $b=0$, then $\gcd(a,0)=|a|=1$.
If $a=0$, choose $r=0$, choose $s=1$, choose $\varepsilon=1$, and choose $\delta=b$. Since $b \in \{1,-1\}$, this gives $\delta \in \{1,-1\}$ and
\begin{align*}
a=0=1\cdot 0^2=\varepsilon r^2,
\qquad
b=b\cdot 1^2=\delta s^2.
\end{align*}
If $b=0$, choose $s=0$, choose $r=1$, choose $\delta=1$, and choose $\varepsilon=a$. Since $a \in \{1,-1\}$, this gives $\varepsilon \in \{1,-1\}$ and
\begin{align*}
a=a\cdot 1^2=\varepsilon r^2,
\qquad
b=0=1\cdot 0^2=\delta s^2.
\end{align*}
Thus the square-factor assertion is proved when $m=0$. For the remaining argument we may assume $m \neq 0$; then $ab=m^2 \neq 0$, so both $a \neq 0$ and $b \neq 0$.
[/guided]
[/step]
[step:Compare prime exponents in the nonzero case]
Assume $m \neq 0$. By the integer [unique prime factorization theorem](/page/Fundamental%20Theorem%20of%20Arithmetic), applied to the nonzero integers $a$ and $b$, there are finite sets of primes $P_a$ and $P_b$, positive integers $\alpha_p$ for $p \in P_a$, positive integers $\beta_q$ for $q \in P_b$, and signs $\varepsilon,\delta \in \{1,-1\}$ such that
\begin{align*}
a=\varepsilon \prod_{p \in P_a} p^{\alpha_p},
\qquad
b=\delta \prod_{q \in P_b} q^{\beta_q}.
\end{align*}
Because $\gcd(a,b)=1$, no prime divides both $a$ and $b$, so
\begin{align*}
P_a \cap P_b=\varnothing.
\end{align*}
Since $m \neq 0$, the integer $m$ has a prime factorization
\begin{align*}
m=\sigma \prod_{\ell \in P_m} \ell^{\mu_\ell},
\end{align*}
where $P_m$ is a finite set of primes, each $\mu_\ell$ is a positive integer, and $\sigma \in \{1,-1\}$. Squaring gives
\begin{align*}
m^2=\prod_{\ell \in P_m} \ell^{2\mu_\ell},
\end{align*}
so every prime exponent in the prime factorization of $m^2$ is even. Since $ab=m^2$, uniqueness of prime factorization identifies the exponent of each prime in $ab$ with its exponent in $m^2$. For $p \in P_a$, the prime $p$ does not lie in $P_b$, so its exponent in $ab$ is exactly $\alpha_p$. Hence $\alpha_p$ is even. Likewise, for $q \in P_b$, the exponent of $q$ in $ab$ is exactly $\beta_q$, so $\beta_q$ is even.
[guided]
We now use prime factorization to turn the condition “$ab$ is a square” into a parity statement about exponents. Since $a$ and $b$ are nonzero integers, the integer [unique prime factorization theorem](/page/Fundamental%20Theorem%20of%20Arithmetic) applies to each of them. It gives finite sets of primes $P_a$ and $P_b$, positive integers $\alpha_p$ for $p \in P_a$, positive integers $\beta_q$ for $q \in P_b$, and signs $\varepsilon,\delta \in \{1,-1\}$ such that
\begin{align*}
a=\varepsilon \prod_{p \in P_a} p^{\alpha_p},
\qquad
b=\delta \prod_{q \in P_b} q^{\beta_q}.
\end{align*}
Here the signs record whether $a$ and $b$ are positive or negative; the prime products record their absolute values.
The coprimality condition $\gcd(a,b)=1$ means that no prime divides both $a$ and $b$. Therefore the prime sets are disjoint:
\begin{align*}
P_a \cap P_b=\varnothing.
\end{align*}
This disjointness is the key point. If a prime $p$ occurs in $a$, then it cannot also occur in $b$, so its exponent in the product $ab$ is exactly the exponent it already had in $a$.
Since $ab=m^2$, the product $ab$ is an integer square. We justify the parity statement from unique factorization. Because $m \neq 0$, unique prime factorization gives a finite set of primes $P_m$, positive integers $\mu_\ell$ for $\ell \in P_m$, and a sign $\sigma \in \{1,-1\}$ such that
\begin{align*}
m=\sigma \prod_{\ell \in P_m} \ell^{\mu_\ell}.
\end{align*}
Squaring this factorization gives
\begin{align*}
m^2=\prod_{\ell \in P_m} \ell^{2\mu_\ell}.
\end{align*}
Thus every exponent appearing in the prime factorization of $m^2$ is even. Since $ab=m^2$, uniqueness of prime factorization forces the exponent of each prime in $ab$ to equal its exponent in $m^2$. Therefore, for each $p \in P_a$, the exponent $\alpha_p$ is even, because it is the exponent of $p$ in $ab$. Similarly, for each $q \in P_b$, the exponent $\beta_q$ is even, because it is the exponent of $q$ in $ab$.
[/guided]
[/step]
[step:Build the square roots of the absolute values of $a$ and $b$]
For each $p \in P_a$, since $\alpha_p$ is even, define the integer $\gamma_p := \alpha_p/2$. For each $q \in P_b$, since $\beta_q$ is even, define the integer $\eta_q := \beta_q/2$. Define
\begin{align*}
r:=\prod_{p \in P_a} p^{\gamma_p},
\qquad
s:=\prod_{q \in P_b} q^{\eta_q},
\end{align*}
with the convention that an empty product is $1$. Then
\begin{align*}
r^2=\prod_{p \in P_a} p^{\alpha_p},
\qquad
s^2=\prod_{q \in P_b} q^{\beta_q}.
\end{align*}
Substituting these identities into the factorizations of $a$ and $b$ gives
\begin{align*}
a=\varepsilon r^2,\qquad b=\delta s^2.
\end{align*}
This proves the square-factor assertion and completes the proof.
[guided]
We have already proved that every exponent in the prime factorization of $a$ and every exponent in the prime factorization of $b$ is even. We now turn that parity information into explicit squares.
For each $p \in P_a$, define the integer $\gamma_p := \alpha_p/2$; this is an integer because $\alpha_p$ is even. For each $q \in P_b$, define the integer $\eta_q := \beta_q/2$; this is an integer because $\beta_q$ is even. Define integers $r$ and $s$ by
\begin{align*}
r:=\prod_{p \in P_a} p^{\gamma_p},
\qquad
s:=\prod_{q \in P_b} q^{\eta_q},
\end{align*}
using the convention that a product over an empty set is $1$. These products are integers because they are finite products of integer powers of primes.
Squaring these definitions doubles every exponent, so
\begin{align*}
r^2=\prod_{p \in P_a} p^{2\gamma_p}=\prod_{p \in P_a} p^{\alpha_p},
\qquad
s^2=\prod_{q \in P_b} q^{2\eta_q}=\prod_{q \in P_b} q^{\beta_q}.
\end{align*}
Substituting these identities into the prime factorizations
\begin{align*}
a=\varepsilon \prod_{p \in P_a} p^{\alpha_p},
\qquad
b=\delta \prod_{q \in P_b} q^{\beta_q}
\end{align*}
gives
\begin{align*}
a=\varepsilon r^2,
\qquad
b=\delta s^2.
\end{align*}
Here $r,s \in \mathbb{Z}$ and $\varepsilon,\delta \in \{1,-1\}$, exactly as required. This proves the square-factor assertion and completes the proof.
[/guided]
[/step]