If we have a function $f$ with the property:
$$f: \mathbb{Z} \rightarrow \mathbb{Z}$$
and if we have a congruence over $\mathbb{Z}$ like so:
$$y\equiv z\pmod{n}$$
What are the conditions to then applying the arbitrary function to both sides?
$$f(y)\equiv f(z)\pmod{n}$$