TITLE: If $ab \equiv r \pmod{p}$, and $x^2 \equiv a \pmod{p}$ then $y^2 \equiv b \pmod{p}$ for which condition of $r$?
QUESTION [6 upvotes]: For the special case $ab \equiv 1 \pmod{p}$, I already got very clear explanation from Arturo Magidin and Quanta in this thread Prove that if $ab \equiv 1 \pmod{p}$ and $a$ is quadratic residue mod $p$, then so is $b$
Now if $ab \equiv r \pmod{p}$, what condition need to be hold in order for this to be true, i.e If $a$ is quadratic residue modulo $p$, then $b$ is also quadratic residue modulo $p$.
My attempt was, I made a concrete example to observe the value of $r$, says $p = 7$. The results are: 1, 4, 5 
$$1^2 \equiv 1 \pmod{7}$$
$$2^2 \equiv 4 \pmod{7}$$
$$3^2 \equiv 2 \pmod{7}$$
$$4^2 \equiv 1 \pmod{7}$$
$$5^2 \equiv 4 \pmod{7}$$
$$6^2 \equiv 1 \pmod{7}$$
So $r$ could be $1$, $2$, $4$, since $4.4 \equiv 1 \pmod{7}$ and $4.2 \equiv 1 \pmod{7}$. From these results, I saw that $r$ was also quadratic residue modulo $p$. 
Another idea that I tried is adapting the proof from the mentioning thread above:
If $ab \equiv r \pmod{p}$, then 
$$aa^{-1}b \equiv ra^{-1} \pmod{p} \Leftrightarrow b \equiv ra^{-1} \pmod{p}$$
$$bb^{-1}a \equiv rb^{-1} \pmod{p} \Leftrightarrow a \equiv rb^{-1} \pmod{p}$$
Then I tried to use the fact that $x^2 \equiv a \pmod{p}$, and $a \equiv rb^{-1} \pmod{p}$ to come with $x^2 \equiv rb^{-1} \pmod{p}$. But I could not find a way to express this in term of $y^2 \equiv b \pmod{p}$. Furthermore, I don't know if this algebraic manipulation could solve the condition for $r$ or not. Any idea? A hint would be greatly appreciated.
Thank you

REPLY [5 votes]: What you are observing is simply the addition tables for $\rm\, \mathbb Z/2\, \cong\, G/G^2,\,\ G = \mathbb (Z/p)^{*}.\:$ The squares form a subgroup of index $2$, so they multiply the same as addition mod $2\, $ (parity addition). With notation: $ $ Square $\rm = S \to 0\in \mathbb Z/2,\ $ Nonsquare $\rm = N\to 1\in \mathbb Z/2,\: $ we have
$$\begin{align}\rm S \:\!*\:\! S\: &=\rm\:\! \:S\,\iff 0 + 0\ \equiv\ 0\\
\rm S * N\ &=\rm\ N\iff 0 + 1\ \equiv\ 1\\
\rm N * N\ &=\rm\ S\, \iff 1 + 1\ \equiv\ 0 
\end{align}\qquad\qquad$$
You can find further examples in my post a couple days ago, which describes various ways of characterizing subgroups, including the complementary view of a subgroup. When you are first learning elementary number theory and group theory, in order to better comprehend the abstract algebraic structures, it is essential to explore many concrete instances of these abstractions. As you can see from the many examples in my linked post, such subgroup laws (and their complements) are already well-known subconsciously in the familiar number systems. The algebraic abstractions serve to "reify" this intuitive knowledge in a more formal structured manner. This is essential in order to cope with such structure when it arises in much more complex scenarios.