About some equations modulo a prime Let $p$ be a prime number. Let $0≤r≤p-1$ be an integer. I am searching for a positive integer $z$ verifying:
$$r^{z}≡0[p]$$
But I have no idea to start. More generally, I am asking about the conditions for that congruence to be true.
 A: It's true if and only if $r = 0$.

Let $p$ be a prime, and let $r$ be an integer with $0 \le r \le p-1$.

Suppose $z$ is a positive integer such that $r^z \equiv 0\;(\text{mod}\;p)$.

\begin{align*}
\text{Then}\;\;&r^z \equiv 0\;(\text{mod}\;p)\\[4pt]
\iff\;&p|r^z\\[4pt]
\iff\;&p|r&&\text{[since $p$ is prime]}\\[4pt]
\iff\;&r=0&&\text{[since $0 \le r \le p-1$]}\\[4pt]
\end{align*}
To explain the last line, note that the only multiple $p$ in the set $\{0,...,p-1\}$ is $0{\,\cdot\,}p = 0$, since the next larger multiple of $p$ is $1{\,\cdot\,}p = p$, which is greater than $p-1$.

Finally, if $r=0$, then $z$ can be any positive integer.
A: If $p$ is a prime number, then the only divisors of $p$ are $1, -1, p$, and $-p$. It follows that,
Lemma 1: If $p$ is a positive prime number and $n$, is any integer, then $$\gcd(p, n) =
\begin{cases} 
   p & \text{If $p \mid n$} \\
   1 & \text{Otherwise}
\end{cases}.$$
Next, We can show that,
Lemma 2: If $p$ is a prime number and $p \mid ab$, then $p \mid a$ or $p\mid b$.
Note that this is only true for prime numbers. For example, $12\mid 6 \times 8$ but $12 \not \mid 6$ and $12 \not \mid 8$.
Proof. If $p \mid a$, then we are done. Suppose $p \not \mid a$. Then $\gcd(p,a)=1$. Then there exists integers $u$ and $v$ such that $pu + av = 1$. Then $b = bpu + abv$. Since $p \mid bpu$ and $p \mid abv$, then $p \mid (bpu + abv) = b$.
So, let $p$ be a prime number and let $0 \le r \le p-1$, then $\gcd(p,r)=1$. Suppose $p \mid r^n$. Then by repeated applications of Lemma 2, $p \mid r$ or $p \mid r$ or $p \mid r$ or  $\dots$ or $p \mid r$. Since $p \not \mid r$, then we must have $p \not \mid r^n$.
