Ring $\rm\color{#c00}{identities}$ (e.g. associative, commutative, distributive laws) that are true in $\,\Bbb Z\,$ are preserved in $\,\Bbb Z_m = \Bbb Z\bmod m\,$ simply because the map $\,h\,:\, a\mapsto a_m\,$ is a surjective (onto) ring hom, i.e. $\,h(a+b) = h(a)+_mh(b),\ $ $h(a\times b) = h(a)\times_m h(b),\, $ so an image of a ring identity (law) in the quotient ring has the same form, i.e. it is preserved, e.g. for associativity of addition we have
$$\begin{align} (a+b)\ \ \ +\ \ \ c\ \ \ &=\ \ \ a\ \ \ \, +\, \ \ \ (b+c)\ \ \ {\rm in}\,\ \Bbb Z\\[.3em]
\Rightarrow\ \ \ \ \ \ \ \ \ \ \ \ \ \, h(a+b)+_m h(c) &= h(a)+_m h(b+c)\ \ \ {\rm in}\,\ \Bbb Z_m\\[.3em]
\Rightarrow\ \ (h(a)+_m h(b))+_m h(c) &= h(a)+_m (h(b)+_m h(c))\\[.3em]
{\rm i.e.} \ \ \ \ \ \ \ \ \,(\bar a\ +_m\ \bar b)\ \ +_m\,\ \ \bar c\ \ &=\ \ \ \ \bar a\,\ +_m\ \ \ (\bar b\ +_m\ \bar c)
\end{align}\qquad\quad$$
Being surjective (onto), for any $\,\bar a,\bar b,\bar c\in \Bbb Z_m\,$ there are $\,a,b,c\in\Bbb Z\,$ that map to them, so the final equality above is true for all elements in $\Bbb Z_m,$ i.e. addition is associative in $\Bbb Z_m$ since it's associative in $\Bbb Z.\,$ Similarly, associativity of multiplication, and other (universal) ring laws are inherited, e.g. the commutative and distributive laws.
Generally this shows that algebraic structures axiomatizable by equational identities (varieties) are closed under homomorphic images, i.e. all identities persist to be true in moduluar images. Varieties are also clearly closed under subalgebras and products. Conversely Birkhoff showed (HSP Theorem) that a class of algebraic structure enjoying these three closure properties can be defined using only equational identities as axioms. For example, fields are not closed under product so they have no such axioms, e.g. we need to use an axiom like $\forall x\neq 0\,\exists y\!:\ xy = 1\,$ which is not an $\rm\color{#c00}{identity}$, i.e. not of form $\,\color{#c00}{\forall x,y}\!:\ f(x,y) = g(x,y)\,$ where $\,f,g\,$ are "polynomials" (i.e. compositions of operations of the algebra, here $+,*,0,1$ for rings).