Prove that if $a^{k} \equiv b^{k} \pmod m $ and $a^{k+1} \equiv b^{k+1} \pmod m $ and $\gcd( a, m ) = 1$ then $a \equiv b \pmod m $
Hint $\rm \ b^k \equiv a^k \Rightarrow\ b^{k+1} \equiv\: b\ a^k \equiv\: a^{k+1} \Rightarrow\ b\equiv a\ $ by cancelling $\rm\ a^k.\: $ Recall that if $\rm\ (a,m) = 1\ $ then $\rm\:a\:$ is invertible, so cancellable, $\!\rm\bmod m,\,$ e.g. by Bezout.
Generally $\rm\,\color{#c00}{A\equiv B},\, aA\equiv b\color{#c00}B\,\Rightarrow\, aA\equiv b\color{#c00}A\,\Rightarrow\, a\equiv b\,$ if $\rm\,A\,$ is cancellable. OP is $\rm\,A,B = a^k,b^k$
The same proof works in any ring where $\rm\:a\:$ is a unit, i.e. invertible. The proof cancels the units $\rm\ a^k = b^k\ $ from both sides of $\rm\ a^{k+1} = b^{k+1}\ $ to obtain $\rm\ a = b\:.\:$ Here we used that unit $\rm\:a\ \Rightarrow\: $ unit $\rm\: b\ $ by $\rm\:b\mid b^k\mid a^k,\,$ and units are closed under products/divisors: $\rm\ xy\:$ unit $\rm\iff\ x\:$ unit and $\rm\:y\:$ unit.
It's clearer dehomogenized using $\rm\ c = b/a\:,\: $ viz. $\rm\ 1 = c^k\ \Rightarrow\ c = c^{k+1} = 1\:$.
Here is the idea: Show that (2) is impossible. Suppose that $$m|\left( a^{k-1}+a^{k-2}\cdot b+\cdots + b^{k-1}\right)$$ and $$m|\left(a^{k}+a^{k-1}\cdot b+\cdots + b^{k}\right)$$ Then subtract $b$ times the first integer from the second integer. That is consider $$\left( a^{k}+a^{k-1}\cdot b+\cdots + b^{k} \right) -b\cdot \left( a^{k-1}+a^{k-2}\cdot b+\cdots + b^{k-1} \right)= a^k$$
It then follows that $m$ divides $a^k$, but that is impossible. (why?)
Hope that helps.
We have $$m|(a^{k}+a^{k-1}b+a^{k-2}b^2 + \cdots + ab^{k-1}+b^k)$$ $$-t(a^{k-1}+a^{k-2}b+a^{k-3}b^2+ \cdots + ab^{k-2} + b^{k-1}) = a^k$$
which is impossible.