Group structure and the composition rule for relative homotopy sets My question below is about relative homotopy groups, but just in order to introduce some notation and to help me draw the parallel, let me first summarize some facts about ordinary homotopy groups (I think mathematicians call them pointed -- although not sure about this). 
The $p$-th homotopy group $\pi_p(M,x)$ of a manifold $M$ with a base-point $x\in M$ is defined as the set of equivalence classes $[f]$ of continuous maps $f$ from $p$-dimensional cube $I^p = [0,1]^p$ to a manifold $M$, such that the boundary $\partial I^p$ is mapped to the base-point. The binary composition $[f_1]\circ [f_2]$ is defined as the equivalence class $[f_1 \circ f_2]$ where by the function composition we mean
$$(f_1 \circ f_2)(x^1,x^2,\ldots) := \left\{\begin{array}{ll}
f_1(2x^1,x^2,\ldots) & \textrm{if $0 \leq x^1 \leq \tfrac{1}{2}$} \\
f_2(2x^1 - 1,x^2,\ldots) & \textrm{if $\tfrac{1}{2} < x^1 \leq 1. $}
\end{array}\right.$$
This is a reasonable way to sew the two function together, because the composition preserves the property that $\partial I^p$ is mapped to the base-point. The inverse element is $[f^{-1}]$ with
$$f^{-1}(x^1,x^2,\ldots) := f(1-x^1,x^2,\ldots)$$
and the identity element is obtained as the equivalence class of the constant function which maps all of $I^d$ into the base-point $m$. So the set of the equivalence classes indeed forms a group -- the homotopy group $\pi_p(M,x)$.
Now, for the $p$-th relative homotopy group $\pi_p(M,X,m)$ of manifold $M$ with a submanifold $X\subset M$ and a base-point $m \in X$, we consider the set of equivalence classes $[f]$ of continuous maps $f$ from $I^p$ with a base-point $x_0\in \partial I^p$ to $M$ such that


*

*$\partial I^p$ is mapped to the submanifold $X\subset M$, and

*the base-point $x_0\in \partial I^p$ is mapped onto the base-point $m \in X$


The problem is, I would like to see that this set indeed forms a group (i.e. the relative homotopy group). However, it is not clear how to define the composition rule and the inverse element. Clearly, just stacking the two maps as in the definition of $f_1\circ f_2$ as above doesn't do the job since this is in general not continuous at $x^1 = \tfrac{1}{2}$. So how does one proceed?
[Btw, I realize that my notation may not be the one usually picked up by mathematicians. Please, feel free to edit and clean the question.] 
 A: This is easier to see with a slightly different definition of $\pi_p(M,X,m)$. Let $J^p=\partial I^{p-1}\times I\cup I^p\times \{0\}$.  That is, $J^p$ is all the boundary faces of the cube $I^p$ except the "top" face where $x^p=1$ (draw a picture for $p=2$ and $p=3$!).  Now we define $\pi_p(M,X,m)$ to be the set of homotopy classes of maps $I^p\to M$ such that the image of $\partial I^p$ is contained in $X$ and every point in $J^p$ maps to $m$.  With this definition, the composition and inverse operations can be defined just as for non-relative homotopy groups, at least if $p>1$ (so that the coordinate $x^1$ used in the operations is not the same as the coordinate $x^p$ used to define the top face).  When $p=1$, there is no natural group structure on $\pi_p(M,X,m)$.
Now, why is this definition equivalent to your definition?  Well, a map $f:I^p\to M$ which maps $J^p$ to $m$ is equivalent to a map $I^p/J^p\to M$ that maps the basepoint to $m$, where $I^p/J^p$ is the quotient space of $I^p$ obtained by identifying all points of $J^p$ together and the basepoint is the one point coming from all of $J^p$.  Now it happens that this quotient $I^p/J^p$ is itself homeomorphic to $I^p$ (the rough idea is that you "stretch" the top face over the entire boundary of the cube, so $J^p$ is reduced to a point and the top face becomes the rest of the boundary).  So instead of maps $I^p\to M$ which map $J^p$ to $m$ (and the top face to $X$), we can consider maps $I^p\to M$ which map just the basepoint to $m$ (and the entire boundary $\partial I^p$ to $X$).
Here is an intuitive geometric way to think of the composition operation directly from your definition (which can be made rigorous with a bit of messy work).  You have two $p$-cubes which map to $M$, sending the boundary to $X$ and the basepoint to $m$.  Think of the cubes as balls instead (since balls are homeomorphic to cubes).  Now "inflate" these balls at their basepoint, so instead of just mapping the basepoint to $m$, they map an entire little $(p-1)$-disk in the boundary around the basepoint to $m$.  Now glue the two balls together along these disks.  This gives you a lumpy shape that looks like two balls smushed together, but it is again homeomorphic to a ball, so we can say we have a single map from a ball to $M$.  The boundary of this ball maps to $X$ (since its boundary is made up of the boundaries of the two original balls), and it maps the basepoint to $m$ if we choose the basepoint to be any point that was on the edge of our little $(p-1)$-disks.
