[proofplan]
We prove the two assertions separately. For injectivity, take an element of $B$ killed by $f_B$, push it to $C$, and use injectivity of $f_C$ to force it into $\ker p = \operatorname{im} i$; then commutativity and injectivity of $f_A$ force the original element to vanish. For surjectivity, start with an element of $\widetilde{B}$, lift its image in $\widetilde{C}$ through $f_C$ and $p$, and then correct the remaining error in $\ker \widetilde{p} = \operatorname{im} \widetilde{i}$ using surjectivity of $f_A$.
[/proofplan]
[step:Prove injectivity of $f_B$ from injectivity of $f_A$ and $f_C$]
Assume that $f_A$ and $f_C$ are injective. Let $b \in B$ satisfy $f_B(b) = 0_{\widetilde{B}}$. Applying $\widetilde{p}$ and using commutativity of the right square gives
\begin{align*}
0_{\widetilde{C}}
= \widetilde{p}(0_{\widetilde{B}})
= \widetilde{p}(f_B(b))
= f_C(p(b)).
\end{align*}
Since $f_C$ is injective, $p(b) = 0_C$. Exactness of the top row at $B$ gives $\ker p = \operatorname{im} i$, so there exists $a \in A$ such that $i(a) = b$.
Using commutativity of the left square,
\begin{align*}
\widetilde{i}(f_A(a))
= f_B(i(a))
= f_B(b)
= 0_{\widetilde{B}}.
\end{align*}
Exactness of the bottom row at $\widetilde{A}$ implies that $\widetilde{i}$ is injective, hence $f_A(a) = 0_{\widetilde{A}}$. Since $f_A$ is injective, $a = 0_A$. Therefore
\begin{align*}
b = i(a) = i(0_A) = 0_B.
\end{align*}
Thus $\ker f_B = \{0_B\}$, so $f_B$ is injective.
[guided]
Assume that $f_A$ and $f_C$ are injective. To prove that $f_B$ is injective, we must prove that the only element of $B$ mapped to $0_{\widetilde{B}}$ is $0_B$. Let $b \in B$ be such that $f_B(b) = 0_{\widetilde{B}}$.
We first move $b$ to the right side of the diagram. Applying $\widetilde{p}: \widetilde{B} \to \widetilde{C}$ to the equality $f_B(b) = 0_{\widetilde{B}}$ and using the commutativity relation $\widetilde{p} \circ f_B = f_C \circ p$, we obtain
\begin{align*}
0_{\widetilde{C}}
= \widetilde{p}(0_{\widetilde{B}})
= \widetilde{p}(f_B(b))
= f_C(p(b)).
\end{align*}
Since $f_C$ is injective, the equality $f_C(p(b)) = 0_{\widetilde{C}}$ forces $p(b) = 0_C$. Exactness of the top row at $B$ says precisely that $\ker p = \operatorname{im} i$. Therefore there exists $a \in A$ such that
\begin{align*}
i(a) = b.
\end{align*}
Now we use the left square. The commutativity relation $f_B \circ i = \widetilde{i} \circ f_A$ gives
\begin{align*}
\widetilde{i}(f_A(a))
= f_B(i(a))
= f_B(b)
= 0_{\widetilde{B}}.
\end{align*}
Exactness of the bottom row at $\widetilde{A}$ implies that $\widetilde{i}: \widetilde{A} \to \widetilde{B}$ is injective, because the preceding map into $\widetilde{A}$ is the zero map and hence $\ker \widetilde{i} = \{0_{\widetilde{A}}\}$. Thus $f_A(a) = 0_{\widetilde{A}}$. Since $f_A$ is injective, $a = 0_A$. Hence
\begin{align*}
b = i(a) = i(0_A) = 0_B.
\end{align*}
We have shown that every element of $\ker f_B$ is zero, so $f_B$ is injective.
[/guided]
[/step]
[step:Prove surjectivity of $f_B$ from surjectivity of $f_A$ and $f_C$]
Assume that $f_A$ and $f_C$ are surjective. Let $\widetilde{b} \in \widetilde{B}$. Since $f_C$ is surjective, there exists $c \in C$ such that
\begin{align*}
f_C(c) = \widetilde{p}(\widetilde{b}).
\end{align*}
Exactness of the top row at $C$ implies that $p$ is surjective, so there exists $b \in B$ such that $p(b) = c$.
Define the error element $\widetilde{e} \in \widetilde{B}$ by
\begin{align*}
\widetilde{e} := \widetilde{b} - f_B(b).
\end{align*}
Using commutativity of the right square,
\begin{align*}
\widetilde{p}(\widetilde{e})
= \widetilde{p}(\widetilde{b}) - \widetilde{p}(f_B(b))
= f_C(c) - f_C(p(b))
= f_C(c) - f_C(c)
= 0_{\widetilde{C}}.
\end{align*}
Thus $\widetilde{e} \in \ker \widetilde{p}$. Exactness of the bottom row at $\widetilde{B}$ gives $\ker \widetilde{p} = \operatorname{im} \widetilde{i}$, so there exists $\widetilde{a} \in \widetilde{A}$ such that $\widetilde{i}(\widetilde{a}) = \widetilde{e}$.
Since $f_A$ is surjective, there exists $a \in A$ such that $f_A(a) = \widetilde{a}$. Then, using commutativity of the left square,
\begin{align*}
f_B(b + i(a))
= f_B(b) + f_B(i(a))
= f_B(b) + \widetilde{i}(f_A(a))
= f_B(b) + \widetilde{i}(\widetilde{a})
= f_B(b) + \widetilde{e}
= \widetilde{b}.
\end{align*}
Therefore every $\widetilde{b} \in \widetilde{B}$ lies in the image of $f_B$, so $f_B$ is surjective.
[guided]
Assume that $f_A$ and $f_C$ are surjective. To prove that $f_B$ is surjective, we start with an arbitrary target element $\widetilde{b} \in \widetilde{B}$ and construct an element of $B$ that maps to it.
First we match the image of $\widetilde{b}$ in $\widetilde{C}$. Since $f_C: C \to \widetilde{C}$ is surjective, there exists $c \in C$ such that
\begin{align*}
f_C(c) = \widetilde{p}(\widetilde{b}).
\end{align*}
Exactness of the top row at $C$ means that $p: B \to C$ is surjective. Hence there exists $b \in B$ such that
\begin{align*}
p(b) = c.
\end{align*}
The element $b$ has the correct image after passing all the way to $\widetilde{C}$, but $f_B(b)$ need not equal $\widetilde{b}$ in $\widetilde{B}$. We measure the difference by defining the error element $\widetilde{e} \in \widetilde{B}$ by
\begin{align*}
\widetilde{e} := \widetilde{b} - f_B(b).
\end{align*}
We now prove that this error lies in the image of $\widetilde{i}$. Applying $\widetilde{p}$ and using the commutativity relation $\widetilde{p} \circ f_B = f_C \circ p$, we get
\begin{align*}
\widetilde{p}(\widetilde{e})
= \widetilde{p}(\widetilde{b} - f_B(b))
= \widetilde{p}(\widetilde{b}) - \widetilde{p}(f_B(b))
= f_C(c) - f_C(p(b))
= f_C(c) - f_C(c)
= 0_{\widetilde{C}}.
\end{align*}
Thus $\widetilde{e} \in \ker \widetilde{p}$. Exactness of the bottom row at $\widetilde{B}$ says that $\ker \widetilde{p} = \operatorname{im} \widetilde{i}$, so there exists $\widetilde{a} \in \widetilde{A}$ such that
\begin{align*}
\widetilde{i}(\widetilde{a}) = \widetilde{e}.
\end{align*}
It remains to lift this correction term back to $A$. Since $f_A: A \to \widetilde{A}$ is surjective, there exists $a \in A$ such that
\begin{align*}
f_A(a) = \widetilde{a}.
\end{align*}
Now add the correction $i(a)$ to $b$. Using that $f_B$ is an $R$-module homomorphism and using the commutativity relation $f_B \circ i = \widetilde{i} \circ f_A$, we compute
\begin{align*}
f_B(b + i(a))
= f_B(b) + f_B(i(a))
= f_B(b) + \widetilde{i}(f_A(a))
= f_B(b) + \widetilde{i}(\widetilde{a})
= f_B(b) + \widetilde{e}
= f_B(b) + \widetilde{b} - f_B(b)
= \widetilde{b}.
\end{align*}
Thus the arbitrary element $\widetilde{b} \in \widetilde{B}$ has a preimage $b + i(a) \in B$ under $f_B$. Therefore $f_B$ is surjective.
[/guided]
[/step]