§ Singular homology: induced homomorphism

The space of chains C[i]C[i] of a topological space XX is defined as all functions ΔiX\Delta^i \rightarrow X. The boundary map is defined as:
[n]:C[n]C[n1][n](σ)i(1)iσ[v[0],v[1],,v[i]^,,v[n]] \begin{aligned} &\partial[n]: C[n] \rightarrow C[n-1] \\ &\partial[n](\sigma) \equiv \sum_i (-1)^i \sigma|[v[0], v[1], \dots, \hat{v[i]}, \dots, v[n]] \end{aligned}
where v[i]^\hat{v[i]} means that we exlude this vertex, and v[0],v[1],v[0], v[1], \dots are the vertices of the domain Δi\Delta^i. Now, say we have a function f:XYf: X \rightarrow Y, and a singular chain complex D[n]D[n] for YY. In this case, we can induce a chain map f:C[n]D[n]f\sharp: C[n] \rightarrow D[n], given by:
f:C[n]D[n]f:(ΔnX)(ΔnY)f(σ)=fσ \begin{aligned} &f\sharp: C[n] \rightarrow D[n] \\ &f\sharp: (\Delta^n \rightarrow X) \rightarrow (\Delta^n \rightarrow Y) \\ &f\sharp(\sigma) = f \circ \sigma \end{aligned}
We wish to show that this produces a homomorphism from H[n](X)ker[n]/im[n+1]H[n](X) \equiv \ker \partial[n]/ im \partial[n+1] to H[n](Y)ker[D][n]/im[D][n+1]H[n](Y) \equiv \ker \partial[D][n] / im \partial[D][n+1]. To do this, we already have a map from C[n]C[n] to D[n]D[n]. We need to show that it sends ker[n]ker[D][n]\ker \partial[n] \mapsto \ker \partial[D][n] and. The core idea is that if we have abelian groups G,HG, H with subgroups M,NM, N, and a homomorphism f:GHf: G \rightarrow H, then this descends to a homomorphism f:G/MH/Nf': G/M \rightarrow H/N iff f(M)Nf(M) \subseteq N. That is, if whatever is identified in GG is identified in HH, then our morphism will be valid. To prove this, we need to show that if two cosets g+Mg + M, h+Mh + M are equal, then their images under ff' will be equal. We compute f(g+M)=f(g)+f(M)=f(g)+0f(g+M) = f(g) + f(M) = f(g) + 0, and f(h+M)=f(h)+f(M)=f(h)+0f(h + M) = f(h) + f(M) = f(h) + 0. Since g+M=h+Mg + M = h+M, we get f(g)=f(h)f(g) = f(h). Thus, the morphism is well-defined.