Why is $\pi_1(X,x_0)$ a group? I want to show that $\pi_1(X,x_0)$ is a group.
I am told that $e(t) := x_0$ is the identity element.
Now, I am struggling to show that it is an identity element, and also that the inverse of an element gives $e$.
I feel like the obvious choice in defining a homotopy between $f\cdot e$ and $f$ (for some path $f : [0,1] \mapsto X$) would be,
$F(s,t) := \begin{cases}
f(\frac{2}{1+s}t) , \space 0\leq t \leq \frac{1+s}{2}\\
x_0 ,\space  \frac{1+s}{2} \leq t \leq 1\\
\end{cases} $ 
And likewise the obvious choice for defining a homotopy between $e$ and $f\cdot f^{-1}$ would be,
$G(s,t) := \begin{cases}
f(2ts) , \space 0\leq t \leq \frac{1}{2}\\
g((2-2t)s) ,\space  \frac{1}{2} \leq t \leq 1\\
\end{cases} $.
But I can't prove that $F$ and $G$ are continuous. So firstly am I on the right line? I.e are these the right maps to be looking at. Secondly: If so, why is it that they are continuous? 
I hope you can shed some light! Thanks!
Edit :
If I can prove the following then I would be done.
I want to show that any function $H : X\times Y \mapsto Z$ is continuous if $H_x(y) := H(x,y)$ is continuous for each $x \in X$ and $H_y(x) := H(x,y)$ is continuous for each $y \in Y$. But I can't prove this either. Neither do I even know whether it is true!
 A: Let $$A=\left\{(s,t)\in [0,1]^2\mid s\in[0,1], 0 \leq t\leq \frac{1+s}{2} \right\}$$ and let $$B=\left\{(s,t)\in [0,1]^2\mid s\in[0,1], \frac{1+s}{2} \leq t\leq 1 \right\}.$$
Note that both are closed subsets of the unit square with non-trivial intersection (given by a diagonal interval from $(0,\frac{1}{2})$ to $(1,1)$), and union the entire unit square.
$F|_A$ (the restriction of $F$ to $A$) is continuous as $f$ is continuous. $F|_B$ is also continuous because it is a constant function. We also have that $F|_A$ agrees with $F|_B$ on the intersection of $A$ and $B$ and so we may use the gluing lemma to define the unique continuous map which restricts to $F|_A$ on $A$ and $F|_B$ on $B$. This map is by definition $F$, and so $F$ is continuous.
A: Another way of doing this is to use paths of arbitrary length. Moore's original definition of this was in terms of pairs $(r,f)$ where $r \geqslant 0$ and $f: [0, \infty) \to X$ is map which is constant on $[r, \infty)$. We define $\partial ^-(r,f)= f(0), \partial^+(r,f)=f(r)$. The composition $(r,f)\circ (s,g)$ is defined if and only if $f(r)=g(0)$ and is then $(r+s,h)$ where $h(t)= g(t)$  for  $ 0 \leqslant t \leqslant s$ and is $f(t-s)$ for $t \geqslant s$. The composition is associative, so this gives a category structure with identities of the form $(0,f)$.  
One also defines $-(r,f)= (r,f')$ where $f'(t) = ???$ (I leave this as an exercise!). 
A homotopy $H: (r_0,f_0) \simeq (r_1,f_1)$ is a pair of continuous functions $$H_1: [0,1] \to [0,\infty), \quad H_2: [0,1] \times [0,\infty) \to X$$ such that  for each $t \in [0,1]$, $H_2(t,s)$ is constant in $s$ for $s \geqslant H_1(t)$ and $H_1(0)=r_0, H_1(1)=r_1,$ $  H_2(0,s)=f_0(s),$ $H_2(1,s)= f_1(s)$. All this is to ensure that for all $ t \in [0,1]$,  $(H_1(t),H_2(t,-))$ is a Moore path. 
One needs essentially only one diagram and formula to show that $-(r,f) \circ (r,f)$ is homotopic to an identity. 
(I'll think a bit as to any improvements in this!)  
One thus obtains the fundamental groupoid $\pi_1 X$. If $X$ is not path connected, one might also want to consider $\pi_1(X,A)$, the full subgroupoid on the points of $A \cap X$, where for example $A$ consists of at least one point in each path component of $X$. This follows the general rule: don't throw away information until you have to. For example, if $X = U \cup V$ and $U \cap V$ is not path connected then you have no rule as to where to choose a single base point.  So choose as many as you like! 
Edit The book Topology and Groupoids takes a slightly different line, in defining a path of length $u$ in $X$ to be a map $a: [0,u] \to X$. One again gets a category of paths, with a reverse, but one needs a  definition of homotopy different to the above. It is easy to define a homotopy rel end points of paths of the same length $u$, as a map from $[0,u] \times [0,1]$ to $X$. If $r,s \geqslant 0$ and $a, b$ are  paths of length $u,v$ then one can define paths $r+a, s+b$ of length $r+u,s+v$ respectively where $r+a$ denotes the obvious path $[0,r+u] \to X$ which is constant on $[0,r]$ and then given by $a$. So one defines $a,b$ to be homotopic rel end points if there are $r,s \geqslant 0$ such that $r+a, s+b$ are of the same length and are homotopic rel end points.  
I leave you to decide which method you like best. The advantage of Moore's definition as pairs is that it leads easily to a space $M(X)$ of Moore paths  in $X$ which contains for  each $x \in X$ a loop space $\Omega(X,x)$ which is a strict topological monoid. 
I also wrote up in arXiv:0909.2212 a shot at Moore hyperrectangles. 
