Relation between the definition of homotopy of two functions and the homotopy of two morphisms of chain complexes What is the relation between the definition of homotopy of two functions

"A homotopy between two continuous functions $f$ and $g$ from a topological space $X$ to a topological space $Y$ is defined to be a continuous function $H : X × [0,1] → Y$ from the product of the space $X$ with the unit interval $[0,1]$ to $Y$ such that, if $x \in X$ then $H(x,0) = f(x)$ and $H(x,1) = g(x)$".

and the definition of the homotopy between two morphisms of chain complexes

"Let $A$ be an additive category. The homotopy category $K(A)$ is based on the following definition: if we have complexes $A, B$ and maps $f, g$ from $A$ to $B$, a chain homotopy from $f$ to $g$ is a collection of maps $h^n \colon A^n \to B^{n - 1}$ (not a map of complexes) such that
   $f^n - g^n = d_B^{n - 1} h^n + h^{n + 1} d_A^n$, or simply $f - g = d_B h + h d_A$." 

Please help me. Thank you!
 A: A homotopy $H : f \to g$ induces a homotopy $H_* : f_* \to g_*$ between the morphisms of singular chain complexes induced by $f$ and $g$. The construction is standard and can be found in Hatcher's book, for instance. 
Hatcher uses simplices for the construction of the singular chain complex. This has the disadvantage of making the construction of $H_*$ not so transparent, as it requires the construction of an intermediate "prism operator" in order to decompose $I \times \Delta^n$ as a union of $\Delta^{n+1}$'s. If you want to really understand how $H_*$ is constructed, I recommend replacing simplices by cubes, because then $I\times I^n$ is already $I^{n+1}$, and the definiton of $H_*$ becomes much more transparent. It is an excellent exercise!
A: In algebraic topology you can construct a functor sending every topological space to a chain complex (the singular complex) and every continuous map between two spaces in a chain map between the corresponding chain complexes.
This mapping can be extended further so that we can associates to every (homotopy classes of) homotopy between two maps an homotopy between the corresponding chain maps. This extend the previous mentioned functor to a $2$-functor from the $2$-category of topological spaces, continuous maps and (homotopy classes of) homotopies to the $2$-category of chain complexes, chain maps and chain homotopies.
Edit What follows is an explanation of the construction of prism operator, since the author of the question asked for (and a comment doesn't seem to be good enough to contain such explanation).
The idea is the following suppose you have an homotopy $H \colon X \times I \to Y$ between the functions $f \colon X \to Y$ and $g \colon X \to Y$.
Then you consider the space $\Delta^n \times I$ with the simplicial structure given by the points $v_i = (e_i,0)$ and $w_i = (e_i,1)$ (where by $e_i$ I denote the $i$-th vertex of standard $n$-simplex $\Delta^n$).
In such $\Delta$-structure you consider the family of simplexes $[v_0 \dots v_i w_i \dots w_n]$ (each $[v_0\dots v_i w_i \dots w_n]$ is the linear map from $\Delta^{n+1}$ to $\Delta^n \times I$ that send the $j$-th vertex of $\Delta^{n+1}$ in $v_j$ for $j \leq i$ and in $w_{j-i}$ for $j \geq i$).
Then it construct the prism operator $P_n \colon C_n(X) \to C_{n+1}(Y)$ in the following way:


*

*it consider a generic $\sigma \in C_n(X)$ and the consider the map $H \circ \sigma \times 1_I \colon \Delta^n \times I \to Y$;

*defined $P_n(\sigma)$ as the linear combination
$$P_n(\sigma) = \sum_{i=0}^{n} (-1)^i H \circ \sigma \times 1_I \circ [v_0\dots v_i w_i \dots w_n]$$

*the morphism $P_n$ is extended to a linear map from $C_n(X)$ by the property of the $\{\sigma \mid \sigma \in \mathbf{Top}(\Delta^n,X)\}$ of being a basis for $C_n(X)$.


(Note that $[v_0\dots v_i w_i \dots w_n] \colon \Delta^{n+1} \to X$ so the linear combination above are really elements of $C_{n+1}(Y)$).
From a little count you can prove that $\delta \circ P + P \circ \delta = g_\# - f_\#$ and so that $P$ is indeed an homotopy of chain maps $f_\#$ and $g_\#$ (which are induced by the maps $f$ and $g$ respectively). 
Hope this helps.
