For prime quadratic integer $\pi$, $x \equiv 1$ (mod $\pi$), Show $x^2 \equiv1$ (mod $\pi^2$) and $x^3 \equiv 1$ (mod $\pi^3$) is not always true. I was working through one of the problems given to me on my problem set for a number theory class and I would like some help in an attempt to learn. Could someone help me with the following question?

Show by counterexample, that if $\pi$ is a prime quadratic integer, and $x \equiv 1 \pmod \pi$, it does not necessarily follow that $x^2 \equiv 1 \pmod {\pi^2}$ or that $x^3 \equiv 1 \pmod {\pi^3}$.

In this case, for the field $\mathbb{Q}(\sqrt{d})$, which is the set of all numbers of the form $a + b(\sqrt{d})$ where $a$ and $b$ are rational numbers, and $d$ is an integer that is not a perfect square, a quadratic integer are the subset of these numbers that can be written as the roots of polynomials of the form $x^2 + mx + n = 0$ where $m$ and $n$ are integers.
I'd really appreciate the help! Thanks!
We are given that quadratic integers in $\mathbb{Q}(\sqrt{-3})$ are of the form $a + b\sqrt{-3}$ where $a$ and $b$ are rational numbers.
I asked my teacher and got the hint that I need to reduce this equation modulo $\lambda^3$ but I'm still confused about how to continue. Could anyone please help? Thanks!
 A: First... does it hold for $p$ an ordinary purely real prime? Consider for example $p = 5$, $x = 21$. Then $x \equiv 1 \pmod p$, $x^2 \equiv 16 \pmod {p^2}$... hmmm... However, it is true that $x^2 \equiv 1 \pmod p$ and $x^3 \equiv 1 \pmod p$ as well.
Now consider the prime $$p = \frac{5}{2} + \frac{\sqrt{-3}}{2},$$ which has a norm of $7$ and is thus said to "split" $7$. One possible choice of $x$ is $11 + 2 \sqrt{-3}$, which has a norm of $133$ and is $4p + 1$. Then we see that $$p^2 = \frac{11}{2} + \frac {5 \sqrt{-3}}{2},$$ $x^2 = 109 + 44 \sqrt{-3}$. We don't actually have to try to divide $x^2$ by $p^2$, it is much easier to see that $x^2 - 1 = 108 + 44 \sqrt{-3}$ has a norm of $17472$, which is a multiple of $7$... okay, we do need to do the division $$\frac{x^2 - 1}{p^2} = \frac{132}{7} - \frac{4 \sqrt{-3}}{7},$$ which is an algebraic number but not an algebraic integer.
A: I think you'd do well to review the meaning of $x \equiv n \pmod m$. It means that there is a number $y$ in the relevant ring such that $x = my + n$.
Then, given a prime number $\pi$ in the ring of algebraic integers of a domain such as $\mathbb Q(\sqrt{-3})$, you seek to prove that $x \equiv 1 \pmod \pi$ does not necessarily mean $x^2 \equiv 1 \pmod {\pi^2}$ nor $x^3 \equiv 1 \pmod {\pi^3}$.
So $x \equiv 1 \pmod \pi$ means there is a number $y$ in the relevant ring such that $x = \pi y + 1$. Then $x^2 = (\pi y + 1)^2 = \pi^2 y^2 + 2 \pi y + 1$. Clearly $x^2 \equiv 1 \pmod \pi$.
But the relationship between $x^2$ and $\pi^2$ is different. In fact, $x^2 \equiv 2 \pi y + 1 \pmod{\pi^2}$, not 1. You might have to make some artihmetic adjustments to the examples in Brook's answer (e.g., 16 and 41 are in the same congruence class modulo 25), but if you do, you'll see I'm right about this.
