Is there any modular law such that:
$a \equiv b \mod k \implies a \equiv ? \mod k^2$
I know that $$ a \equiv b \mod k \implies a^n \equiv b^n \mod k $$ but sometimes I need to power only $k$ and then there are examples when it is not so easy to investigate without any theorem.
The left hand side means $k\mid(a-b)$. Square to get $k^2\mid (a-b)^2$. You can write that as $a\equiv a^2+(1-2b)a+b^2\bmod{k^2}$, though it is a bit artificial.