Prove that there exists an $m$ such that $p^2| m^2-2m+2$ Let $p$ be an odd prime, and let $n$ be a natural number such that $p| n^2 -2n +2$ . Show that there exists an $m$ such that $p^2|m^2 -2m+2$. 
This is supposed to be an exercise in Hensel's Lemma, but I don't know how to apply it.
 A: Since $p \mid n^2 - 2n + 2$, then
$$n^2 - 2n + 2 = ip^2 + jp, \; i,j \in \mathbb{Z}, \; 0 \le j \le p -1 \tag{1}\label{eq1A}$$
If $j = 0$, then you can simply choose $m = n$, with this working for checking either $m^2 - 2n + 2$ or $m^2 - 2m + 2$ being divisible by $p^2$.
Otherwise, consider the case of asking to have prove an $m$ exists such that $p^2 \mid m^2 - 2n + 2$, as the original question text asked. However, when I reread your question later and noticed you said it was for an exercise with Hensel's lemma, I realize you likely didn't mean this. Nonetheless, I'm leaving this first part FYI, as well as anybody else who's interested.
Note since $p$ is odd, then $p \not\mid n$, so $n$ has a multiplicative inverse modulo $p^2$. Let $k$ be this, i.e., so
$$kn \equiv 1 \pmod{p^2} \implies kn = qp^2 + 1 \tag{2}\label{eq2A}$$
for some $q \in \mathbb{Z}$. Next, if $j$ is even, let
$$r = \frac{j}{2} \tag{3}\label{eq3A}$$
else if $j$ is odd, let
$$r = \frac{j + p}{2} \tag{4}\label{eq4A}$$
Next, let
$$m = n + krp \tag{5}\label{eq5A}$$
to get
$$\begin{equation}\begin{aligned}
m^2 - 2n + 2 & = (n - krp)^2 - 2n + 2 \\
& = n^2 - 2krpn + (kr)^2(p^2) - 2n + 2 \\
& = n^2 - 2n + 2 - 2rp(kn) + (kr)^2(p^2) \\
& = ip^2 + jp - 2rp(qp^2 + 1) + (kr)^2(p^2) \\
& = ip^2 + jp - 2rqp^3 - 2rp + (kr)^2(p^2) \\
& = (i - 2rqp + (kr)^2)(p^2) + (j - 2r)p
\end{aligned}\end{equation}\tag{6}\label{eq6A}$$
With either \eqref{eq3A} you have that $(j - 2r)p = 0$ while for \eqref{eq4A}, you have that $(j - 2r)p = -p^2$. In either case, you can see that
$$p^2 \mid m^2 - 2n + 2 \tag{7}\label{eq7A}$$
as requested.
Next, consider the other possibility of showing there's an $m$ such that $p^2 \mid m^2 - 2m + 2$. Note, in \eqref{eq1A}, that $n \not\equiv 1 \pmod p$, which is equivalent to the Alternative statement that, with $f(n) = n^2 - 2n + 2$, you have $f'(n) \not\equiv 0 \pmod p$ since $f'(n) = 2n - 2 = 2(n-1)$.
With the lemma, you're basically done with showing an $m$ exists. However, to determine what the $m$ values are, the argument in the Derivation section, applied to your polynomial, is basically as follows.
There's a solution $a$ to the congruence equation
$$2a(n-1) \equiv -j \pmod p \implies 2a(n-1) = qp - j \tag{8}\label{eq8A}$$
for some $q \in \mathbb{Z}$. With $m = n + ap$, you now have
$$\begin{equation}\begin{aligned}
m^2 - 2m + 2 & = (n + ap)^2 - 2(n + ap) + 2 \\
& = n^2 + 2apn + (ap)^2 - 2n - 2ap + 2 \\
& = n^2 - 2n + 2 + (a^2)(p^2) + 2a(n - 1)p \\
& = ip^2 + (a^2)(p^2) + jp + (qp - j)p \\
& = (i + a^2 + q)(p^2)
\end{aligned}\end{equation}\tag{9}\label{eq9A}$$
You also now get $p^2 \mid m^2 - 2m + 2$.
