Define $f(n)$ to be the number of quadratic residues modulo $n$. I would like to show that $f$ is multiplicative, that is, for any positive integers $m,n > 1$, $f(mn) = f(m)f(n)$ whenever $(m,n) = 1$.
Let $S_n$ be the set of quadratic residues modulo $n$. Then my idea is to create a bijective map from $S_{mn}$ to $S_m \times S_n$.
Define the map $x \mod{mn} \mapsto (x \mod{m}, x \mod{n}$).
To show this is injective, suppose that two elements $x, x'$ from $S_{mn}$ map to the same ordered pair, that is $(x' \mod{m}, x' \mod{n}) = (x \mod{m}, x \mod{n})$. This implies both $m$ and $n$ divide $x - x'$. However, $(m,n) = 1$, so $mn$ divides $x - x'$.
To show this is surjective, we wish to show that for any ordered pair $(a \mod{m}, b \mod{n})$ there is an element $x$ in $S_{mn}$ that maps to it. By the Chinese Remainder Theorem, we have a unique solution to the system of congruences $x \equiv a \mod{m}$ and $x \equiv b \mod{n}$.
Here I am stuck. How do I show that $x$ must be an element of $S_{mn}$? I know I must continue using the Chinese Remainder Theorem but I am not seeing how to get the result I need.