Example 4 Find the last three digits of $7^{10000}$ and $7^{9999}$
To find the last three digits of a number, it is equivalent to finding the remainder of this number when divided by 1000.
Since $\varphi(1000)=\varphi\left(2^{3} \cdot 5^{3}\right)=2^{2} \cdot 5^{2} \cdot 4=400$.
Therefore, by Euler's theorem, we have $7^{400} \equiv 1(\bmod 1000)$.
Thus, $7^{10000} \equiv 7^{400 \cdot 25} \equiv 1^{25} \equiv 1(\bmod 1000)$, which means
the last three digits of $7^{10000}$ are $0,0,1$.
Since $7 \cdot 7^{9999}=7^{10000} \equiv 1 \equiv 1001(\bmod 1000)$, we have
$7^{9999} \equiv \frac{1001}{7} \equiv 143(\bmod 1000)$.
Therefore, the last three digits of $7^{9999}$ are $1,4,3$.
Note: To find the last three digits of $7^{9999}$, one should first find the last three digits of $7^{10000}$. This is because the latter can be quickly determined using Euler's theorem.