An element $a\in U_n$ is said to be a quadratic residue modulo $n$ if $a=b^2$ for some $b\in U_n$. Now we know that the set of all quadratic residues form a group $Q_n$. Now, we define an epimorphism by the map $f:U_n\to Q_n$ by $f(x)=x^2$. Then $U_n\,/\ker f\simeq Q_n$.
Now, $\ker f = \{x\in U_n: x^2=1\}$, then the square root modulo $n$ of $a$ is the set $f^{-1}(a)$ which is a coset of $\ker f$. Now I want to understand what is exactly going on here? I mean the number of square roots of $1$ is the same as number of square roots of $a$? Also can someone suggest a text for quadratic residues?