A proof is pretty easy though, basically euler-fermat formula states that a^phi(n) = 1 mod n where phi(n) is the number of integers coprime to n and less than n, if a is co-prime to n.
now phi(10) = 4, so a^4 = 1 for all invertible a, so a^5 = a for all invertible a.
Not sure how to show if for a not invertible, can't be arsed to think.
have you heard of the mathematian, fermat? check out his little theorum.
If x is an integer, and in x^(p), p is a prime number, and x and p are coprime to eachother. x^(p)-x will be evenly divisible by p.
so x^p = x mod p .. coprime means x and p have no common factor other than 1 or -1. check out euler's totient function sometime.
anyhow you have mod 2p which is a tweak on fermat's thm.
basicly you'd be doing two divisions for x^(p)-x. once for your p, which divides evenly, then dividing by two, which is just 0/2. move the a over to the right again and you have:
x^(p)=x mod 2p p=5 and x is coprime to 5 (ie. 2,3,13,91)
i hope that's correct enough, I don't know how to account for non-coprime x's and p's