Find the number of non-zero elements in the field $Z_p$, where $p$ is an odd prime number, which are squares, i.e. of the form $m^2$; $m \in Z_p$; $m \neq 0$.
please help how can i solve this problem? the number of nonzero element is $p-1$ here
Find the number of non-zero elements in the field $Z_p$, where $p$ is an odd prime number, which are squares, i.e. of the form $m^2$; $m \in Z_p$; $m \neq 0$.
please help how can i solve this problem? the number of nonzero element is $p-1$ here
Let $G$ be the set of non-zero elements of $\mathbb{Z}_p$. $G$ is a commutative group of order $p-1$. Let $f\colon G \rightarrow G^2$ be the map such that $f(m) = m^2$. $f$ is a surjective homomorphism. Hence $G^2$ is isomorphic to $G/\ker(f)$. Since $\ker(f) = \{1, -1\}$ and $p$ is odd, $|ker(f)| = 2$. Hence $|G^2| = (p-1)/2$.
Hint $\ $ The nonzero elements of $\rm\,\Bbb Z_p\,$ form a cylic group $\rm\:G\:$ of order $\rm\,p-1 = 2n.\:$ Written additively, $\rm\:G\,\cong\, \Bbb Z_{2n},\:$ where squares $\rm\,x^2\in G\,$ become doubles $\rm\:2\,\hat x\,\in Z_{2n}.\:$ Hence the question reduces to counting the number of even classes in $\rm\,\Bbb Z_{2n},\:$ which is clearly $\rm\:n,\:$ viz. $\rm\,0,2,4,\ldots,2n.$
The answer below is very close to the one by Makoto Kato, with much of the group-theoretic language stripped away. It could all be removed, leaving an argument in the pure language of congruence.
Let $\mathbb{Z}_p^*$ be set of non-zero elements of $\mathbb{Z}_p$. Define the map $f:\mathbb{Z}_p^*\to \mathbb{Z}_p^*$ by $f(x)=x^2$. Now the argument proceeds by showing that for any (non-zero) $a$, the equation $x^2=a$ has either two solutions or none.
Note that if $(-x)^2=x^2$. Suppose now that $f(x)=f(y)$. Then $x^2=y^2$, and therefore $(x-y)(x+y)=0$. But the only way that a product $ab$ of two elements of $Z_p$ can be $0$ is if $a=0$ or $b=0$. So if $(x-y)(x+y)=0$ then $y=x$ or $y=-x$.
Finally, note that if $x$ is in $\mathbb{Z}_p^*$, we cannot have $-x=x$. For $-x=x$ iff $2x=0$. Since $p$ is odd, $2$ is invertible, and therefore $2x=0$ forces $x=0$.
So the mapping $f(x)=x^2$ is two-to-one on $\mathbb{Z}_p^*$. It follows that exactly half of the elements of $\mathbb{Z}_p^*$ are squares.
If you know about primitive roots, then the squares mod $p$ are of the form $g^{2k}$, where $g$ is a primitive root, and so there are $(p-1)/2$ squares because $g$ has order $p-1$.