Homotopy equivalence of two different gluings of $B^n$ and an arbitrary space $X$ Let $f, g: S^{n-1} \to X$ be a pair of homotopic continuous maps. Let $X \cup_f B^n$ and $X \cup_g B^n$ be the respective adjunction spaces (pushouts of $B^n \hookleftarrow S^{n-1} \rightarrow X$). I need to show that $X \cup_f B^n$ and $X \cup_g B^n$ are homotopy-equivalent.
I can just about convince myself that it's true by imagining deformations of one into another by embedding in some ambient space, but I guess this isn't possible in general. 
I also tried proving this by general abstract nonsense but got nowhere, and then I realised I hadn't used any special properties of $B^n$ at all. What properties should I be looking at? A friend mentioned that his solution used the fact that $B^n \setminus U$, where $U \subset S^{n-1}$ is open, is homotopy-equivalent to $B^n$ or something like that, but I haven't been able to make any sense of that remark.
Edit: After thinking a little more, by more general abstract nonsense, I think I've figured out how to get a sort of deformation map, and it seems to work for arbitrary spaces, so let $S$ be a subspace $B$, and let $h: S \times I \to X$ be a homotopy from $f: S \to X$ to $g: S \to X$. Let $H: S \times I \to X \times I$ be the map $(s, t) \mapsto (h(s, t), t)$. Let $(X \times I) \cup_H (B \times I)$ be the pushout of $B \times I \hookleftarrow S \times I \xrightarrow{H} X \times I$. Then, by the universal property of pushouts, we have a projection $p: (X \times I) \cup_H (B \times I) \to I$ that agrees with the obvious projections, and injections $X \cup_f B \to (X \times I) \cup_H (B \times I)$, and indeed it's even $p^{-1}(\{0\})$. Then, by the universal property of $(X \times I) \amalg (B \times I) \simeq (X \amalg B) \times I$, we have a map $(X \amalg B) \times I \to (X \times I) \cup_H (B \times I)$. So we have a homotopy from the quotient map $X \amalg B \to X \cup_f B$ to the quotient map $X \amalg B \to X \cup_g B$. But I'm not sure this is any help...
 A: There are two ways of trying to build homotopy equivalence maps between $X \cup_f B_n$ and $X \cup_g B_n$.
One is to try to have $B_n$ stay fixed, and have things happen in $X$ instead.
If you find a construction which works for an arbitrary space $S$, it would be one of this kind.
The other is to try to have $X$ stay fixed, and have things happen in $B_n$ instead.
Since we know what $B_n$ is and we don't know what $X$ is, it should be easier to do it this way.
So we want a continuous map $F : X \cup_f B_n \rightarrow X \cup_g B_n$, where $\forall x \in X, F(x) = x$.
This means that we only want to find its restriction $F|_{B_n} : B_n \rightarrow X \cup_g B_n$, such that $\forall x \in S_{n-1}, F(x) = f(x)$
Now then, if you want to use the homotopy $h : S^{n-1} \times [0;1] \rightarrow X$ between $f$ and $g$, it makes sense to try to decompose $B^n$ and build something like this :
$$B_n \approx (S^{n-1} \times [0;1]) \cup B_n \rightarrow X \cup_g B_n$$
Finding such a decomposition and checking that the glueing works well is straightforward.
Proving that the maps you obtain are an equivalence of homotopy, when you properly write down what their composition does, should be easy as well.
A: You should be looking at the fact that $S^{n-1} \to B^n$ is a cofibration.
EDIT:
This is a response to your below comment. There is a certain diagram that tells you what a cofibration is, it is annoying and ugly at first, but eventually it will make some amount of sense. The idea this diagram is supposed convey is that $A \to X$ (think of $A$ as a subspace of $X$) is a cofibration if we have a function out of $X$, say $f:X \to Y$, then once we have a homotopy of $f$ restricted to $A$ then we get a homotopy of "all" of $f$. There are many ways to think about cofibrations though, not all of them are easy to understand. Morally, a cofibration is a map $i: A \to X$ s.t. $X/i(A)$ behaves well in the eyes of homotopy theory, that is the homotopy type of $X/i(A)$ depends only on the homotopy class of $i$. 
A couple of important points about cofibrations is that every map is homotopic to a cofibration, think about the mapping cylinder. Also, if you have the inclusion of a subspace $A$ into $X$ where $X$ is obtained from $A$ by attaching cells then that inclusion is a cofibration, this is an easy way of noticing that map in question is a cofibration. Now since it is a cofibration and since you have a homotopy then the quotients should be the same. That last sentence can be made precise, think about what the pushout is actually the quotient of and how you can fit your attaching map into that picture.
A: If everything is a CW complex there is the more general fact that any two homotopic maps
$$
f,g:B\longrightarrow Y
$$
for $B\subseteq X$ produce homotopic spaces $Y\cup_f X\simeq Y\cup_g X$ where we attach $X$ along $B$ by $f$.  If $F:B\times I\longrightarrow Y$ is the homotopy then you can think about $Y\cup_F (X\times I)$.  Then this becomes the fact that for CW pairs $(Z,A)$ you have a deformation retract of $Z\times I$ onto $(Z\times\{0\})\cup (A\times I)$.
