Let $p$ be an odd prime number, $a,b\in\mathbb{Z}$ such that $\gcd(a,p)=\gcd(b,p)=1$ and $a\equiv b\pmod{p}$. Prove that $a^ n\equiv b^n\pmod{p^k}$ if and only if $n(a-b)\equiv 0 \pmod {p^k}$ in which $k,n\in\mathbb{N}$.
This is what I did(spoiler: I did almost nothing):
$p$ is an odd prime number, therefore $(\mathbb{Z}/p^k\mathbb{Z})^\times =\{\overline{x}\in\mathbb{Z}/p^k\mathbb{Z}:\gcd (x,p^k)=1\}$ with the multiplication is a cyclic group. By hypothesis we have that $\gcd(a,p)=1$ and $\gcd(b,p)=1$. Therefore $\gcd(a,p^k)=1$ and $\gcd(b,p^k)=1$ which implies that $\overline{a},\overline{b}\in (\mathbb{Z}/p^k\mathbb{Z})^\times$.
Let $\varphi(n)$ be the Euler's totient function. Then the cardinality of $(\mathbb{Z}/p^k\mathbb{Z})^\times$ is $\varphi(p^k)=(p-1)p^{k-1}$.
$(\Rightarrow)$ Suppose that $\overline{a}^n=\overline{b}^n$. Therefore $\overline{ab^{-1}}^n=1$.
My strategy is to prove that $ab^{-1}$ is a generator of the group $(\mathbb{Z}/p^k\mathbb{Z})^\times$ because this implies that $\varphi(p^k)$ is the order of $ab^{-1}$ which implies that $\varphi(p^k)|n$. I believe that this can indeed occur since, by hypothesis, $a\equiv b\mod p\Rightarrow ab^{-1}\equiv 1\pmod{p}$. But unfortunately I could not prove it.
If $\varphi(p^k)|n$, then exists $m\in\mathbb{Z}$ such that $n=\varphi(p^k)m$. We know that $a-b=cp$ in which $c\in\mathbb{Z}$. Therefore $n(a-b)=(p-1)p^{k-1}mcp=(p-1)p^kcm\Rightarrow n(a-b)\equiv 0 \mod p^k$. Therefore we can prove this implication if $\varphi(p^k)|n$. But does this actually occur?
Could someone please help me?
Below are some lemmas that may be helpful.
Lemma 1: Let $p$ be a prime number. If the class of $x\in\mathbb{Z}$ generates $\mathbb{Z}/p\mathbb{Z}$ then $\overline{x}$ or $\overline{x+p}$ generates $(\mathbb{Z}/p^2\mathbb{Z})^\times$.
Lemma 2: Let $p$ be an odd prime number. If the class of $x\in\mathbb{Z}$ generates $(\mathbb{Z}/p^2\mathbb{Z})^\times$ then it also generates $(\mathbb{Z}/p^k\mathbb{Z})^\times$.
Lemma 3: Let $m\geq 1$ be an integer. Then $|\{\overline{x}\in (\mathbb{Z}/p^k\mathbb{Z})^\times :\overline{x}^m=1\}|=\gcd(m,\varphi (p^k))$. Here |A| means the cardinality of the set $A$.
EDIT: I realized that the above strategy will not work. To see this, just pick $(p,a,b,k,n)=(3,5,2,2,3)$. But I thought of other strategies:
We know that $\overline{ab^{-1}}^n=\overline{1}$. Let $c=ab^{-1}$. Therefore $c^n\equiv 1\pmod {p^k}\Rightarrow (c-1)(1+c+\cdots +c^{n-1})\equiv 0\pmod {p^k}$.
If we demonstrate that $1+c+\cdots +c^{n-1}\equiv n\pmod {p^k}$, then we will finish the demonstration. Maybe we can prove this using $c=ab^{-1}\equiv 1\pmod p$.
Let $c\equiv ab^{-1}\pmod{p^k}$, then we can prove instead that $$ c^n\equiv 1 \pmod{p^k} \Longleftrightarrow n(c-1)\equiv 0 \pmod{p^k} $$
Proof. Let $c\equiv g^u\pmod{p^k}$ for some $0\leq u< p^{k-1}(p-1)$. Since $$ a\equiv b \pmod p \implies g^u\equiv c\equiv ab^{-1}\equiv 1 \pmod p, $$ this shows that $$ u\equiv 0 \pmod{p-1} \implies u=(p-1)w $$ for some integer $w$.
$$\tag*{$\square$}$$
So we are reduced to proving $$ g^{(p-1)nw}\equiv c^n\equiv 1\pmod{p^k} \Longleftrightarrow n(g^{(p-1)w}-1)\equiv 0 \pmod{p^k} $$
The next step is to split the proof depending on how many times $p$ divides $n$. Write $$ n = p^tm,\quad \gcd(m,p)=1 $$
Case 1: $t\geq k-1$
If $t\geq k-1$, then both sides are trivially true: $$ \begin{align} g^{(p-1)nw} &\equiv (g^{(p-1)p^{t}})^{mw} \equiv (1)^{mw} \equiv 1 \pmod{p^k}\\ n(g^{(p-1)w}-1) &\equiv (mp^{t})(c-1) \equiv 0 \pmod{p^k} \end{align} $$ (Recall that $c-1 \equiv 0\pmod p$ is a given condition.)
Case 2: $t\leq k-2$
Next we assume that $0\leq t \leq k-2$. (We are also assuming $k\geq 2$, since $k=1$ is trivial.) Then starting on the LHS we have
$$ \begin{align} g^{(p-1)nw}-1 &\equiv 0 \pmod{p^k}\\ g^{(p-1)p^tmw}&\equiv 1 \pmod{p^k}\\ (p-1)p^tmw &\equiv 0 \pmod{p^{k-1}(p-1)}\\ p^tmw &\equiv 0 \pmod{p^{k-1}}\\ p^tw &\equiv 0 \pmod{p^{k-1}},\quad \text{since }\gcd(m,p)=1\\ (p-1)p^tw &\equiv 0 \pmod{p^{k-1}(p-1)}\\ (p-1)w &\equiv 0 \pmod{p^{k-t-1}(p-1)}\\ g^{(p-1)w}-1 &\equiv 0 \pmod{p^{k-t}}\\ m(g^{(p-1)w}-1) &\equiv 0 \pmod{p^{k-t}}\\ p^t m(g^{(p-1)w}-1) &\equiv 0 \pmod{p^k}\\ n(g^{(p-1)w}-1) &\equiv 0 \pmod{p^k} \end{align} $$
Since we transformed LHS to RHS, they are equivalent. (Edit 1: I felt like I could have jumped from step 2 to step 8.)