I just wanted to check to be sure I was correct as the more I stare at my proof the more I doubt myself.
Suppose you have a commutative diagram of $R$-modules with exact rows: $$ \newcommand{\ra}[1]{\kern-1.5ex\xrightarrow{\ \ #1\ \ }\phantom{}\kern-1.5ex} \newcommand{\ras}[1]{\kern-1.5ex\xrightarrow{\ \ \smash{#1}\ \ }\phantom{}\kern-1.5ex} \newcommand{\da}[1]{\bigg\downarrow\raise.5ex\rlap{\scriptstyle#1}} \begin{array}{c} & A & \ra{m} & B & \ra{q} & C & \ra{} & 0 & \\ & \da{f} & & \da{g} & & & & \\ & X & \ras{n} & Y & \ras{r} & Z & \ra{} & 0 \\ \end{array} $$ Prove that there exists a map $h: C \to Z$ commutating the diagram.
Proof (?): As $q$ is a surjective map, for all $c \in C$ there is a $b \in B$ such that $q(b)=c$. Define the map $h: C \to Z$ by $c \mapsto rg(b)$, where $b \in B$ is such that $q(b)=c$. This map clearly commutes the diagram. It only remains to show that this map is well defined.
Suppose $b,b' \in B$ such that $c=q(b)=q(b')$. We need show that $rg(b)=rg(b')$. That is, we need show that $g(b)-g(b') \in \ker r$. By exactness, $\ker r = \text{im } n$. It suffices to show that $g(b)-g(b')=g(b-b')$ is in $\text{im } n$.
We know $q(b-b')=q(b)-q(b')=c-c=0$ so that $b-b' \in \ker q$, which by exactness is the image of $m$. Then there is an $a \in A$ such that $f(a)=b-b'$. But by commutativity, we know $nf(a)=gm(a)$. That is, $nf(a)=g(b-b')$. But then $n(f(a))=g(b-b')$ so that $g(b-b') \in \text{im }n$, as desired.
Is this correct?
It looks correct to me! Not sure what else to say as an answer.