Quoted By:
Since this question sucks ass over the reals, I'll give a different perspective.
Over Z/pZ the answer is p-1 or p+1, depending on whether p = 1 or 3 mod 4.
By vertex I mean a point (x,y) such that x^2 + y^2 = 1 mod p.
For the proof I'll need the Dirichlet character/Legendre symbol chi(x),
i.e. chi(0) = 0, chi(a) = 1 if a is a square, and chi(a) = -1 if a is a non-square.
I remind you of the following properties of chi:
chi(a*b) = chi(a)*chi(b)
chi(-1) = 1 if p = 1 mod 4 and chi(-1) = -1 if p = 3 mod 4
sum_{a in Z/pZ} chi(a) = 0
|{b : b^2 = a}| = 1 + chi(a)
We abbreviate sum_{a in Z/pZ} as just sum_{a}
Proof of Theorem:
|{(x,y) : x^2 + y^2 = 1}| = sum_{a} (1 + chi(a)) * (1 + chi(1-a))
= p + sum_{a} chi(a) + sum_{a} chi(1-a) + sum_{a} chi(a * (1-a))
= p + sum_{a} chi(a * (1-a))
= p + chi(-1) * sum_{a} chi(a^2 - a)
So it only remains to show that sum_{a} chi(a^2 - a) = 1.
We'll use a trick, where we multiply by 1, aka chi(4):
sum_{a} chi(a^2 - a) = sum_{a} chi(4a^2 - 4a)
= sum_{a} chi((2a - 1)^2 - 1)
= sum_{a} chi(a^2 - 1), since we can rewrite 2a - 1 to a
Now we add p and subtract p:
... = -p + sum_{a} 1 + chi(a^2 - 1)
= -p + sum_{a} |{b : b^2 = a^2 - 1}|
= -p + sum_{a} |{b : (a-b)*(a+b) = 1}|
= -p + sum_{c} |{d: cd = 1}|, again by variable substitution
= -p + (p - 1), since only 0 has no inverse
= -1
QED