The lecture notes I am working through assert, but leave as an exercise, that if $n\mid m$, then the map $f:\mathbb{Z}/m\to \mathbb{Z}/n$ sending$$x\mapsto x\pmod n$$is a surjective homomorphism. My definition of $\mathbb{Z}/k$ for any $k>1$ is the set $\{0,1,\ldots ,k-1\}$ with addition defined by$$(a,b)\mapsto \begin{cases} a+b & \text{if}\quad a+b<k, \\ a+b-k & \text{otherwise}. \end{cases}$$I've seen similar versions of this result with the domain and codomain reversed, but never in this form, so I'm trying to determine whether this is a typo. The map essentially maps the remainder mod $m$ to the Euclidean remainder mod $n$. I'm going to show my attempt this far.
If $n\mid m$, then for some $k\in \mathbb{N}$, we have $nk=m$. Denoting addition $\pmod m$ by $*_m$ and addition $\pmod n$ by $*_n$, I want to show that for any $a,b\in \mathbb{Z}/m$, we have$$f(a*_mb)=f(a)*_nf(b).$$Suppose first that $a+b<m$ in $\mathbb{Z}$. Then $a*_mb=a+b$, and we have$$f(a*_mb)=f(a+b)=(a+b)\pmod n.$$At this point I'm stuck. If $n,m$ are positive integers, then the fact that $n\mid m$ implies that $n\leq m$. I have $a+b<m$ in this first case, but I could have $n<a+b\leq m$, which implies that I need to consider additional cases. I can certainly do that, but I think I must be missing something, because I can't think of a way to use the assumption that $n\mid m$.