Let an modular equation be as follows:
$a\equiv b^c\mod{n},$
and we don't know the $b$ coefficient. So, to find $b$ we can raise both sides to $\frac{1}{c}$ (or $c^{-1}$) power like this:
$a^{\frac{1}{c}}\equiv b\mod{n}.$
Consider simple case, in which all conditions (of modular arithmetic) are satisfied, why, after raising to this power, we have to calculate $\ c^{-1}$ in $\mod{n-1}$, not $\mod{n}$:
$\frac{1}{c}\equiv 1\cdot c^{-1} \mod{n-1}.$
To illustrate this problem, I have an example:
$77\equiv x^{51}\mod{107}$ ( $x=5$ satisfing this equation),
$77^{\frac{1}{51}}\equiv x \mod{107}$.
If we compute $\frac{1}{51}\equiv 21 \mod{107}$, then:
$77^{21}\equiv66\mod{107}\neq5\mod{107}$,
so we have to get $\frac{1}{51}\mod{106}\equiv79$:
$77^{79}\equiv5\mod{107}$.
My question, again, is why it works in this way, is any theorem talks about it (inverse power)?
Regards
First, $n-1$ is not always the correct modulus - that only works when $n$ is prime. In general, we have to use the modulus $\phi(n)$ where $\phi$ is the Euler totient function, defined as the number of integers between 1 and $n$ that are relatively prime to $n$.
Briefly, the reason for this is that $a^{\phi(n)} \equiv 1 \mod{n}$ for $(a,n)=1$ (Euler's theorem). This implies that exponents in an expression mod $n$ are actually periodic with period $\phi(n)$, so exponents should be treated as a value mod $\phi(n)$.
Note that this method only works when $(c, \phi(n)) = 1$ since otherwise the fraction $1/c$ doesn't exist modulo $\phi(n)$. So there are a lot of interesting cases where it doesn't work, e.g., if $c$ is even then it pretty much never works since $\phi(n)$ is always even for $n > 2$.