let $M_1,..., M_n$ be left modules over R, and $M = M_1 \bigoplus ... \bigoplus M_n$. Suppose that if $i \neq j$, then every homomorphism from $M_i$ to $M_j$ are zero.
Show that
$$End{}_{R}(M) \cong End{}_{R}(M_1) \times ... \times End{}_{R}(M_n)$$.
Any help would be great.
 A: Define
$$\Psi : \mathrm{End}_R(M) \to \prod_i \mathrm{End}_R(M_i), \ \phi \mapsto \prod_i \phi_i$$
 where $\phi_i$ does the following: given $m_i \in M_i$, $\phi_i(m_i)$ is the $i-$th component of $\phi(0 + \dots + 0 + m_i + 0 + \dots+0)$. Show that $\Psi$ is a morphism, injective and surjective.
Edit:
Actually, "the $i-$th component of $\phi(0 + \dots + 0 + m_i + 0 + \dots+0)$" is just the whole image, because of the assumption. There is a much more general form of the statement, namely
$$\mathrm{End}_R(M) \cong \prod_{i,j} \mathrm{Hom}_R(M_i, M_j).$$
This directly implies what you want to prove. In particular, in your case $\Psi$ would not be injective without your assumption. I guess at this point the best thing to do is to give an idea of why the general fact holds. Define
$$\Psi : \mathrm{End}_R(M) \to \prod_{i,j} \mathrm{Hom}_R(M_i, M_j), \ \phi \mapsto \prod_{i,j} \phi_{i,j},$$
where $\phi_{i,j}$ does the following: given $m_i \in M_i$, $\phi_{i,j}(m_i)$ is the $j-$th component of $\phi(0 + \dots + 0 + m_i + 0 + \dots+0)$. An inverse of $\Psi$ is given by
$$\Psi^{-1} :  \prod_{i,j} \mathrm{Hom}_R(M_i, M_j) \to \mathrm{End}_R(M), \ \prod_{i,j} \phi_{i,j} \mapsto \phi,$$
$$\text{where} \quad \phi\left(\sum_i m_i \right) := \sum_{i,j} \phi_{i,j}(m_i).$$
If we only consider $\prod_i \mathrm{End}_R(M_i)$, instead of the larger $\prod_{i,j} \mathrm{Hom}_R(M_i, M_j)$, then we can still define $\Psi$ and $\Psi^{-1}$ in a similar way, but $\Psi$ would not be injective and $\Psi^{-1}$ would not be surjective (unless your assumption holds): $\Psi \circ \Psi^{-1}$ would still be the identity, but not $\Psi^{-1}\circ \Psi$, because it would forget all the mixed terms.
Note: If the direct sum where infinite, then neither the general fact nor your specific case would hold: $\Psi$ would not be surjective and $\Psi^{-1}$ would not be well-defined. Indeed, if I choose all the $\phi_{i,j}$ to be non-zero, then $\prod_{i,j}\phi_{i,j}$ cannot be in the image of $\Psi$. Similarly,
$$\Psi^{-1} \left( \prod_{i,j}\phi_{i,j} \right) \notin \mathrm{End}_R(M).$$
But we still have an even more general statement, that also holds in the infinite case:
$$\mathrm{Hom}_R\left(\bigoplus_i M_i, \prod_i M_i\right) \cong \prod_{i,j} \mathrm{Hom}_R(M_i, M_j),$$
which is a direct consequence of the following two facts: for any $R-$module $N$, we have
$$\mathrm{Hom}_R\left(\bigoplus_i M_i, N\right) \cong \prod_{i} \mathrm{Hom}_R(M_i, N), \quad \mathrm{Hom}_R\left(N, \prod_i M_i\right) \cong \prod_{i} \mathrm{Hom}_R(N, M_i).$$
A: Let $p_i:M\to M_i$ be the projection and $q_i:M_i\to M$ the obvious inclusion.
Then $$1=\sum q_ip_i.$$. Now if $f:M\to M$ is an endomorphism then 
$$f=\sum q_ip_if$$ however 
$$q_ip_if| M_j=0$$ if $i\neq j$ thus we have 
$$q_ip_if| M_i=f|M_i$$ 
