Let $R$ be a ring and let $M$ and $N$ be right $R$-modules such that the only $R$-homomorphisms $M\to N$ and $N\to M$ are the $0$-maps. Prove that $\text{End}_{R}(M\oplus N) \cong \text{End}_{R}(M)\oplus \text{End}_{R}(N)$ (isomorphic as rings). To what extent can this be generalized to $X$-groups?
My attempt:
Define a map $\Lambda:\text{End}_{R}(M\oplus N)\to \text{End}_{R}(M)\oplus\text{End}_{R}(N)$ by $\varphi \mapsto (\varphi_{1}, \varphi_{2})$ (the first and second coordinates of the output of $\varphi$). First we have to check that this map makes sense: are $\varphi_{1}$ and $\varphi_{2}$ $R$-endomorphisms of $M$ and $N$ respectively? If $m_{1},m_{2}\in M$, $n_{1},n_{2}\in N$, and $r\in R$ then since $\varphi$ is an $R$-endomorphism we have \begin{align*} (\varphi_{1}(m_{1}+m_{2})r,\varphi_{2}(n_{1}+n_{2})r) &= \varphi((m_{1}+m_{2},n_{1}+n_{2}))r\\ &= \varphi((m_{1},n_{1})r)+\varphi((m_{2},n_{2})r) \\ &= (\varphi_{1}(m_{1}r),\varphi_{2}(n_{2}r)) + (\varphi_{1}(m_{2}r),\varphi_{2}(n_{2}r)) \end{align*} so that $\varphi_{1}$ and $\varphi_{2}$ are $R$-endomorphisms.
Now we check that $\Lambda$ is a ring homomorphism. Let $\varphi,\psi\in\text{End}_{R}(M\oplus N)$. Then for $m\in M$ and $n\in N$ we have $$\Lambda(\varphi\circ\psi)(m,n) = (\varphi_{1}\circ\psi_{1}(m),\varphi_{2}\circ\psi_{2}(n) ) = \Lambda(\varphi)(\Lambda(\psi)(m,n)) =\Lambda(\varphi)\circ\Lambda(\psi)(m,n)$$ so that $\Lambda(\varphi\circ \psi) = \Lambda(\varphi)\circ\Lambda(\psi)$ and $\Lambda$ respects multiplication in the rings. For addition, we have \begin{align*} \Lambda(\varphi+\psi)(m,n) &= ((\varphi_{1}+\psi_{1})(m),(\varphi_{2}+\psi_{2})(n)) \\ &= (\varphi_{1}(m),\varphi_{2}(n))+(\psi_{1}(m),\psi_{2}(n)) \\ &= \Lambda(\varphi)(m,n) + \Lambda(\psi)(m,n). \end{align*}
Lastly we check that $\Lambda$ is injective and surjective so that it is a ring isomorphism. For surjectivity, if $(\varphi_{1},\varphi_{2})\in\text{End}_{R}(M)\oplus\text{End}_{R}(M)$ then we have an $R$-endomorphism $\varphi$ of $M\oplus N$ by $(m,n)\mapsto (\varphi_{1}(m),\varphi_{2}(n))$ and clearly $\Lambda(\varphi) = (\varphi_{1},\varphi_{2})$. For injectivity, if $\Lambda(\varphi) = (0,0)$ (the $0$ endomorphisms) then $\varphi((m,n)) = (0,0)$ for all $m\in M$ and $n\in N$, making $\varphi$ the $0$ endomorphism of $M\oplus N$.
If $M$ and $N$ are $X$-groups then we will have $\text{End}_{X}(M\oplus N)\cong \text{End}_{X}(M)\oplus\text{End}_{X}(N)$ because we never used the ring structure of $R$ in the work above.
My concern: I think it cannot be correct since I did not use the assumption that there are only trivial $R$-homomorphisms between $M$ and $N$. Can someone spot where I am going wrong (or maybe it is all nonsense) so I can fix it?
This sentense is the source of problem.
Your definition of $\Lambda$, written down clearly, is: $\Lambda(\phi) = (\phi_1, \phi_2)$, where $\phi_1$ sends any $m\in M$ to the first component of $\phi(m, 0)$ and $\phi_2$ sends any $n \in N$ to the second component of $\phi(0, n)$.
Therefore $\Lambda(\phi) = (0, 0)$ means that we have $\phi(m, 0) = (0, *)$ for any $m \in M$ and $\phi(0, n) = (*, 0)$ for any $n \in N$. This does not imply $\phi(m, n) = (0, 0)$.
As an example, take $M = N$ and define $\phi \in \operatorname{End}_{R}(M\oplus N)$ by $\phi(m, n) = (n, m)$. This is then in the kernel of your $\Lambda$ and is nonzero.
The fix is exactly the hypothesis that $\operatorname{Hom}_R(M, N) = 0$ and $\operatorname{Hom}_R(N, M) = 0$. I leave the verification to you.