After having defined the equivalence classes of paths in a topological space in chapter two of the book A Basic Course in Algebraic Topology, William S. Massey proves the lemma
The multiplication of equivalence classes of paths is associative.
That is, if $f,g,h$ are paths in $X$ with the terminal point of $f$ being the initial point of $g$, and the terminal point of $g$ being the initial point of $h$ (such that multiplication is defined), then $(f \cdot g) \cdot h = f \cdot (g \cdot h)$.
He defines the function $F(t,s) = \begin{cases} f \left( \frac{4t}{1+s} \right), & 0 \leq t \leq \frac{s+1}{4} \\ g(4t-1-s), & \frac{s+1}{4} \leq t \leq \frac{s+2}{4} \\ h \left( 1 - \frac{4(1-t)}{2-s} \right), & \frac{2+s}{4} \leq t \leq 1. \end{cases}$
This function is continuous and satisfies $F(t,0)=[(f \cdot g) \cdot h]t$ and $F(t,1) =[f \cdot (g \cdot h)]t$ so the lemma is proved. However, he includes the following diagram: 
He claims this to be the motivation behind defining $F(t,s)$. Can somebody explain how this is the motivation behind defining $F(t,s)$?
The way I see it, we have to continuously go from the first case of $[(f \cdot g) \cdot h]$ to $[f \cdot (g \cdot h)]$. The $s=1$ represents the latter, and $s=0$ the former. The two sloped lines connecting points from $s=0$ with $s=1$ is what ensures the continuity of the function when $s \in (0,1)$. But this seems rather vague, perhaps you can clarify a little bit.
At the request of Mike Miller, here is the (or an) explanation :)
This picture illustrates the relationship between the functions $f,g,$ and $h$. The left quadrangle is $f$, middle one $g$ and right one $h$. We start out at the situation $[(f \cdot g) \cdot h]t$ and end up at $[f \cdot (g \cdot h)]t$ - initially $f$ and $g$ should have their $t$-interval to be 1/4 and $h$ should have 1/2, whereas in the end $f$ should have 1/2 and $g$ and $h$ 1/4. This is achieved by piecewise linearly sliding the parametrization. And, for each $s$, we can draw a horizontal line and the intersection points mark where the functions are equal to each other.