concerning the definition of homotopy extension property 1) Let $X$ be a topological space, and let $A \subset X$. We say that the pair $(X,A)$  has the homotopy extension property if, given a homotopy $f_t\colon A \rightarrow Y$ and a map $\tilde{f}_0\colon X \rightarrow Y$ such that $\tilde{f}_0 |_A = f_0$, there exists an extension of $\tilde{f}_0$ to the homotopy $\tilde{f}_t\colon X \rightarrow Y$ such that $\tilde{f}_t|_A = f_t$.
Most textbooks states that this is equivalent to the following.
2) The pair $(X,A)$ has the homotopy extension property if any map $F\colon (X\times \{0\} \cup A\times I) \rightarrow Y$ can be extended to a map $F'\colon X\times I \rightarrow Y$(i.e. F and F' agree on their common domain).
I can see easily that $~~$  1$\implies$2, but in showing that $~~$ 2$\implies$1,  I construct the map G:$X\times \{0\} \cup A\times I\to Y$ such that G(x,o)= $\tilde{f}_0(x)$ $\forall$ x $\in X$ and G(a,t)= $f_t(a)$ $\forall$ a $\in A$ and t $\in I.$ I need to show that G is continuous but I can't use the gluing lemma since A is arbitrary. Can someone help me to solve this problem.
 A: At first glance I thought that the second property is weaker than the first, but it is indeed equivalent. To deduce 1) from 2), you should first show that 2) implies that $X\times\{0\}\cup A\times I$ is a retract of $X\times I$. This is easy, just let the map $F$ be the identity on $X\times\{0\}\cup A\times I$, and you get the retraction.  
Now, if $Y:=X\times\{0\}\cup A\times I$ is a retract of $X\times I$, it can be shown that a subset $O\subset Y$ is open in $Y$ if its intersections with $X\times\{0\}$ and $A\times I$ are open in these two subspaces. This implies
that a function on $Y$ is continuous if its restrictions to $X\times\{0\}$ and to $A\times I$ are continuous, hence your $G$ is indeed continuous.
You can read this in the revised Appendix of Hatcher's Algebraic Topology on page 532. The free online version of his textbook includes all corrections.  
This gives you the equivalence if $A$ is not closed. Still, if $X$ happens to be Hausdorff, then $A$ must be closed, since $Y$ is closed as a retract of a Hausdorff space.
A: I think you have a good point here. 
The correct result seems to be that for a map $i: A \to X$  one should consider the pushout 
$$ \matrix{A \times \{0\} &\to& A \times I \\
\downarrow & & \downarrow\\
X \times \{0\} & \to & M(i)}$$
as defining the mapping cylinder of $i$. This pushout diagram determines  a map $\mu: M(i) \to X \times I$. Then $i$ being a cofibration is equivalent to the existence of a map $\rho: X \times I \to M(i)$ such that $\rho \mu = 1$, i.e. $\mu $ is a coretraction. The definition of $M(i)$ as a pushout gives of course the gluing property that you want. 
This is stated as 7.2.4 of Topology and Groupoids. (It was also in the 1968, 1988 differently titled editions. Attention to gluing problems are a feature of this book. It contained the first statement of a gluing theorem for homotopy equivalences.) 
The Corollary is that $i$ is a cofibration implies that $\mu$ is an embedding. 
I do not have an example where $\mu$  is not an embedding, but there seems no reason why it should be in general. 
