Definition. A pair $(X,A)$ of topological space $X$ and its subspace $A$ satisfies Borsuk property if for any topological space $Y$ and for any continuous map $f \colon X \to Y$ any homotopy $F_A \colon A \times I \to Y$, $F_A(x,0) = f|_A$ can be continued to homotopy $F \colon X \times I \to Y$, $F(x,0) = f$.
Theorem. If $(X,A)$ satisfies Borsuk property and $A$ is contractible then $X$ and $X/A$ are homotopy equivalent.
Proof. Let $A$ be contractible, i.e. $id_A \sim a \in A$. By Borsuk property this homotopy can be continued to homotopy $id_X \sim f$, where $f|_A = a$. Define $\varphi \colon X / A \to X$ by the rule $\varphi([x]) = f(x)$ if $x \not\in A$ and $\varphi([x]) = a$ otherwise and let $\pi \colon X \to X/A$ be a usual projection. We need to show that $\varphi \circ \pi \sim id$ and $\pi \circ \varphi \sim id$. First is easy since $\varphi \circ \pi = f \sim id$. But how to show that $\pi \circ \varphi \sim id$?
First of all $\pi:X\to X/A$ induces a quotient map $\pi\times \mathbf1:X\times I\to X/A\times I$.
Now let $F:X\times I\to X$ be the homotopy induced by the contraction $\mathbf 1_A\simeq a $ on $A$ and the identity $\mathbf1_X$. Since $F[A\times I]=A$ the composition $\pi\circ F:X\times I\to X\to X/A$ induces a homotopy $\bar F:X/A\times I\to X/A$. Denote $f_t(x)=F(x,t)$, then $f_1$ is the $f$ in your question.
Since $\pi f_t=\bar f_t\pi$, we get $\pi f=\bar f\pi$.
Now $\pi\varphi([x])=\pi\varphi\pi(x)=\pi f(x)=\bar f\pi(x)=\bar f([x])$.
But this $\overline f$ is homotopic to the identity on $X/A$ via $\bar F$