Let $M_i, i \in I$, be R-modules. Show that the (external) direct product $\prod_I M_i$ satisfies the following universal property relative to the R-homomorphisms $\pi_j:\prod_I{M_i} \to Mj$ defined by $\{m_i\}_I \to m_j$ for all $j \in I$: Given an R-module $M$ and R-homomorphisms $g_j : M \to M_j$ for all $j \in I$, there exists a unique R-homomorphism $h:M → \prod_I M$ satisfying $g_j =π_j\circ h$ ,for all $j\in I$.
I have no idea how to start on this problem. Please help. Thanks!