congruent to mod p $1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$ Let $p$ be an odd prime.How to prove that
$$1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$$

I find that this identity is stated in this paper:
Lehmer, E. "On Congruences Involving Bernoulli Numbers and the Quotients of Fermat and Wilson." Ann. Math. 39, 350-360, 1938 :
http://www.jstor.org/discover/10.2307/1968791?uid=2134&uid=2&uid=70&uid=4&sid=56284309973
Equation (30) in the paper answers your question.
EDIT:
In fact,we can use a simpler method to solve this problem.
Let $q(a)=\frac{a^{p-1}-1}{p}$ for all $a$ such that $\gcd(a,p)=1$.
It is not difficult to show that $q(ab) \equiv q(a)+q(b) \pmod{p}...(1)$.
Let $a$ be an arbitrary integer which is relatively prime to $p$.
For each $v \in \{1,2,...,p-1\}$,let $av=\lfloor{\frac{av}{p}} \rfloor p+r_v$.
Then we can see that $r_v$,($r=1,2,...,p-1$) also runs over ${1,2,...,p-1}$.
So $q(av)=((\lfloor{\frac{av}{p}} \rfloor p+r_v)^{p-1}-1)/p\equiv q(r_v)-\lfloor{\frac{av}{p}} \rfloor r_v^{p-2} \equiv q(r_v)-\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}$
So, $\sum_{v=1}^{p-1} q(av) \equiv \sum_{v=1}^{p-1} (q(r_v)-\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor)\equiv \sum_{v=1}^{p-1} q(v)-\sum_{v=1}^{p-1}\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}...(2)$
Then by $(1),(2)$,we get $q(a) \equiv \sum_{v=1}^{p-1}\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}...(3) $
Take $a=2$, $\frac{2^p-2}{p} \equiv \sum_{v=1}^{p-1}\frac{1}{v} \left \lfloor \frac{2v}{p} \right \rfloor \equiv \sum_{p/2 <v} \frac{1}{v} \equiv -\sum_{v=1}^{(p-1)/2} \frac{1}{v} \equiv -\sum_{v=1}^{(p-1)/2} v^{p-2} \pmod{p}$
As a result,
$1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$
