The question is fairly general. Suppose I have a homotopy commutative diagram of the form
\begin{equation} \require{AMScd} \begin{CD} A @>{f}>> B\\ @V{h}VV @V{i}VV \\ C @>{g}>> D \end{CD} \end{equation}
meaning that there is a homotopy from $i\cdot f$ to $g\cdot h$. Suppose further I'm given a space $A'$ which is homotopy equivalent to $A$, i.e. I'm given maps $a:A\to A'$, $a':A'\to A$ such that $a\cdot a'$ and $a'\cdot a$ are homotopic to the identity, respectively on $A'$ and $A$.
It would seem quite natural for me to have homotopy commutativity for the diagram
\begin{equation} \require{AMScd} \begin{CD} A' @>{f\cdot a'}>> B\\ @V{h\cdot a'}VV @V{i}VV \\ C @>{g}>> D \end{CD} \end{equation}
since the original diagram is commuting up to homotopy, and somehow the spaces are indistinguishable, again up to homotopy. However, I don't see how to prove this: these homotopy equivalences seem to get handy just when they come in pairs one after the other, and here I have just one - namely, $a'$.
The initial problem was related to a similar diagram, where $B=A$, and it seems to hold that
\begin{equation} \require{AMScd} \begin{CD} A' @>{a\cdot f\cdot a'}>> A'\\ @V{h\cdot a'}VV @V{i\cdot a'}VV \\ C @>{g}>> D \end{CD} \end{equation}
homotopy commutes. This $f$ stuck in the middle irritates me, and, although the solution seems to be at hand, I can't seem to find it.
Which is why any hint is greatly appreciated. :-)
Suppose $i \circ f \simeq g \circ h$, then you can pick a concrete homotopy $H: I×A → D$ where $I$ is the unit interval and $H_0 = i \circ f$, $H_1 = g \circ h$. (Here $H_t(x)$ denotes $H(t, x)$ and $H_t : A → D$.)
You can precompose this map with $id_I × a'$ to get $\overline{H} : I × A' → D$ defined as $\overline{H}(t\in I, x\in A') = H(t, a'(x) \in A)$. Then the restriction $\overline{H}_0 = i \circ (f \circ a')$ and $\overline{H}_1 = g \circ (h \circ a')$. This is a homotopy which shows $i \circ (f \circ a') \simeq g \circ (h \circ a')$.
Note that you don't use “$a'$ is a homotopy equivalence” in this proof.