Let $p>5$ be a prime.
How to solve $x^x = y^y \mod p$? How many solutions are there for a given $p$ such that $x,y < p$?
I know the discrete logarithm and the theory of quadratic residues, but I'm not sure if that helps.
Question 2
How many $p$ exist such that at least $(p-1)/2$ residues are of the form
$$ r = a^b = b^a \mod p $$
question 1: $x\equiv y$ is the trivial answer. knowing parity arguments seems more useful, odd mod odd is opposite the integer multiplier for example. So $3^3$ is 6 mod 7 so it's multiplier is odd (3 in fact). $3^5$ is 5 mod 7 so it's multiplier is even (34 which is 6 mod 7 in this case). So odd pairs (x,y) depend on being in the same parity multiplier. You can do similar mod 3 etc. That will narrow it down.