I am trying to solve these two problems on diagrams of module morphisms:
1) Let $$\begin{array}{c} M' & \xrightarrow{f_1} & M & \xrightarrow{f_2} & M'' \\ & & \downarrow{\beta} & & \downarrow{\gamma} \\ N' & \xrightarrow{g_1} & N & \xrightarrow{g_2} & N'' \\ \end{array}$$
a commutative diagram of $R$-modules with horizontal exact lines and $g_1$ injective. Show that there exists a unique morphism $M' \to N'$ that completes the diagram.
2) Let $$\begin{array}{c} M' & \xrightarrow{f_1} & M & \xrightarrow{f_2} & M''&\rightarrow &0 \\ \downarrow{\alpha} & & \downarrow{\beta} \\ N' & \xrightarrow{g_1} & N & \xrightarrow{g_2} & N'' \\ \end{array}$$
a commutative diagram of $R$-modules with exact horizontal lines. Show that there is a unique morphism $\gamma:M'' \to N''$ which completes the diagram.
In 1) I have the following doubt: suppose the image of $\beta \circ f_1$ is "bigger" than the image of $g_1$. Then, no matter how I define $\alpha$, I am not gonna get $\beta \circ f_1=g_1 \circ \alpha$.
In 2), if $\gamma$ exists then $\gamma \circ f_2=g_2 \circ \beta$, and since $f_2$ is surjective, then for all $x \in M''$, there is $m \in M$ with $f_2(m)=x$. I am confused on how to explicitly define $\gamma$ in each $x \in M''$, I mean, by the condition above I see there is only one way of defining it but I don't know how to explicitly show the morphism.
Any help with the problem would be greatly appreciated.
Consider $$\require{AMScd} \begin{CD} {} @. M' @>f_1>> M @>f_2>> M'' \\ @. @. @V\beta VV @V\gamma VV \\ 0 @>>> N' @>g_1>> N @>g_2>> N'' \end{CD} $$ Without loss of generality we can assume that $N'$ is a submodule of $N$ and that $g_1$ is the inclusion map. Since $g_2\beta f_1=\gamma f_2f_1=0$, we know that the image of $\beta f_1$ is contained in $\ker g_2=N$ and the statement is proved.
The second statement is dual.