Classes that are their multiplicative inverses

My teacher has demonstrated this problem at class but I didn't understand at the time, and now I can't find any material in internet about this specific problem:

"How can I prove that in the finite field Zp, where p is a prime number, the only elements that are their own inverse are 1 and -1?"

I do understand Fermat's little theorem, and I know how to prove that each element has only one inverse, but I can't solve this problem. I would be very thankful if someone could help me with this.

Actually, how can I prove that in integers, the only numbers that are their own multiplicative inverses are 1 and -1?

Hint: A polynomial with coefficients in a field has exactly as many roots (with multiplicity) in the algebraic closure of the field as its degree. Can you write down a polynomial which is satisfied by elements which are their own multiplicative inverses?

• Do you mean something like $x^2= 1$? – Caio Hirakawa Jul 4 '17 at 4:55
• Exactly. If you rearrange this, you get $x^2 - 1 = 0$, and $x^2 - 1$ is a polynomial with coefficients in a field (either $\Bbb F_p$ or $\Bbb Q$, depending on where you're looking for elements which are their own multiplicative inverse). So, you just need to find all (two) roots of $x^2 - 1$. Since $\Bbb Z\subseteq\Bbb Q$, if you find the roots of $x^2 - 1$ as a polynomial over $\Bbb Q$, you'll find the elements of $\Bbb Q$ which are their own multiplicative inverse, and you'll have found the elements of $\Bbb Z$ which are their own multiplicative inverse as well. – Stahl Jul 4 '17 at 4:58
• You can also get by with the weaker result: in $\Bbb F_p$ and $\Bbb Z$, $ab = 0$ if and only if $a = 0$ or $b = 0$. It follows from this that in $\Bbb F_p$ or $\Bbb Z$, a polynomial has at most as many roots as its degree. – Stahl Jul 4 '17 at 5:24

Hint $\ x = x^{-1}\!\! \iff\! x^2\! = 1$ $\!\iff\! (x\!-\!1)(x\!+\!1) = 0$ $\!\iff\! x\!+\!1=0\ {\rm or}\ x\!-\!1 = 0$ $\!\iff\! x= \pm 1$ because, in a field (or domain) we have $\,ab = 0\iff a=0\,$ or $\,b=0\,$.

Remark  More generally, a ring $D$ is a domain $\iff$ every nonzero polynomial $f$ over $D$ has at most $\deg f$ roots in $D$. See also the Bifactor Theorem for the general quadratic case.

• To avoid misunderstandings, it would be good to make explicit that you define domains to be commutative. – Daniel Fischer Jul 7 '17 at 14:23
• @Daniel That is the most common definition (i.e. domain = integral domain). – Bill Dubuque Jul 7 '17 at 14:25
• I don't know what's most common, but if you go to wikipedia, they don't assume commutativity. Since wikipedia is a much used source, I think it's safer to be explicit. – Daniel Fischer Jul 7 '17 at 14:38
• @Daniel Wikipedia is far from an authority on such matters. This is not the correct place for an extended discussion on mathematical terminology preferences. There is much ambiguity in mathematics, and we cannot solve it here (e.g. do rings include $1$ and must $1$ be preserved by ring homs? are rings commutative, associative? etc). These are usually resolved by context, and in this context (elementary number theory), domains are almost always commutative. – Bill Dubuque Jul 7 '17 at 14:40