Let $a$ be a quadratic residue modulo $p$. Prove $a^{(p-1)/2} \equiv 1 \bmod p$.

Solution 1:

Hint $\ $ Put $\rm\ a = b^2\ $ and use Fermat's little theorem.

Note $\ $ The converse is also true - it is known as Euler's criterion.

Solution 2:

Bill has succintly told you how to prove the result. But you were also asking for comments on your proposed argument. I will address that.

In line 5, where did the $v$ come from, and what is its role? Notice that you can take $v=1$ and what you write is true. So how is this giving you any information?

In line 9, you are already using an inverse of $k$, even though you only assert its existence in the next line. You cannot do that: in order to use it, you must first show it exists, and you haven't done it.

But assuming it does exist, and that your entire chain of argument holds, you'll notice that all you concluded was that $v\equiv 1\pmod{(p-1)/2}$. This is of course natural: you have $a=g^c=g^{2k}=g^{2kv}$; you can always take $v=1$ and that will work regardless of $k$, $g$, $a$... And you probably know now that it does not lead to a proof.

So you had not actually proven anything. You've only written $a$ as an even power of a primitive root, and that's it. Lines 1 through 4 are correct; but from line 5 through the end, you are just spinning your wheels and not getting any closer to the result you want.