Preorder Preservation versus Congruence Preservation
Looking at some monoids and (semi)rings (natural numbers, integers and $p$-adic integers), and more generally, residually finite algebras (in a strong sense), we prove the equivalence of two ways for a function $f$ on such an algebra to behave like the operations of the algebra. The first way is to preserve congruences or stable preorders. The second way is to demand that, for any (recognizable) set $L$, a suitably chosen lattice (or Boolean algebra) generated by $L$ be closed under inverse images by the function $f$.