[proofplan]
We start with a chain homotopy $s_\bullet$ from $f$ to $g$. For precomposition by $a$, we compose each homotopy component on the right with $a_n$ and use the chain map identity for $a$ to move $d^C$ past $a$. For postcomposition by $b$, we compose each homotopy component on the left with $b_{n+1}$ and use the chain map identity for $b$ to move $b$ past $d^D$. These two computations give exactly the two required chain homotopy equations.
[/proofplan]
[step:Precompose the given homotopy with $a$]
For each integer $n$, define the $R$-[linear map](/page/Linear%20Map)
\begin{align*}
t_n: B_n &\to D_{n+1} \\
x &\mapsto s_n(a_n(x)).
\end{align*}
We prove that $t_\bullet$ is a chain homotopy from $f \circ a$ to $g \circ a$. Since $a$ is a chain map, its components satisfy
\begin{align*}
d^C_n a_n = a_{n-1} d^B_n
\end{align*}
for every integer $n$. Therefore, for every integer $n$,
\begin{align*}
(f_n a_n - g_n a_n)
&= (f_n - g_n)a_n \\
&= (d^D_{n+1}s_n + s_{n-1}d^C_n)a_n \\
&= d^D_{n+1}(s_n a_n) + s_{n-1}(d^C_n a_n) \\
&= d^D_{n+1}t_n + s_{n-1}a_{n-1}d^B_n \\
&= d^D_{n+1}t_n + t_{n-1}d^B_n.
\end{align*}
This is precisely the chain homotopy equation for the pair $f \circ a$ and $g \circ a$. Hence $f \circ a$ and $g \circ a$ are chain homotopic.
[/step]
[step:Postcompose the given homotopy with $b$]
For each integer $n$, define the $R$-linear map
\begin{align*}
u_n: C_n &\to E_{n+1} \\
x &\mapsto b_{n+1}(s_n(x)).
\end{align*}
We prove that $u_\bullet$ is a chain homotopy from $b \circ f$ to $b \circ g$. Since $b$ is a chain map, its components satisfy
\begin{align*}
d^E_{n+1}b_{n+1} = b_n d^D_{n+1}
\end{align*}
for every integer $n$. Therefore, for every integer $n$,
\begin{align*}
(b_n f_n - b_n g_n)
&= b_n(f_n - g_n) \\
&= b_n(d^D_{n+1}s_n + s_{n-1}d^C_n) \\
&= b_n d^D_{n+1}s_n + b_n s_{n-1}d^C_n \\
&= d^E_{n+1}b_{n+1}s_n + (b_n s_{n-1})d^C_n \\
&= d^E_{n+1}u_n + u_{n-1}d^C_n.
\end{align*}
This is precisely the chain homotopy equation for the pair $b \circ f$ and $b \circ g$. Hence $b \circ f$ and $b \circ g$ are chain homotopic.
[/step]