This is used in construction of $\mathbb Q$ from $\mathbb Z$ as definition of positive.
This condition tells us when two fractions represent the same rational number (belong to the same equivalent class):
$$\frac mn = \frac pq \qquad\Leftrightarrow\qquad mq=pn.$$
So under the assumptions that $mn=pq$, $n\ne0$, $q\ne0$ and $m,n,p,q\in\mathbb Z$ we want to show that $mn>0$ implies $pq>0$. We are allowed to use known properties of $\mathbb Z$.
Let us have a look at $mn\ge0$ instead. If we multiply both sides of the inequality by $(mq)^2$, the inequality does not change, since $(mq)^2\ge0$. And we will then use that $(mq)^2=mqpn$, which follows from $mq=pn$.
\begin{align*}
mn&\ge0\\
mn\cdot(mq)^2&\ge0\\
mn\cdot mqpn &\ge 0\\
m^2n^2pq&\ge0\\
pq&\ge 0
\end{align*}
This solves similar problem with strict inequality. I.e., in this way we can show $mn\ge0 \Leftrightarrow pq\ge0$.
So it remains to check when a fraction is equal to zero and what happens in that case.