If $M_1$ and $M_2$ are R-modules, $R$ possibly non-commutative. Show that $M_1 \oplus M_2$ is projective $\iff M_1$ and $M_2$ are both projective
I have no idea how to solve this. By definition an $R$-module is defined to be projective if the functor $Hom_R(P,−): RMod \to Ab$ is exact. Any help is appreciated
You use the universal property of the coproduct (i.e. direct sum in our case) to see that $\mathrm{Hom}_R(M_1\oplus M_2,-)\cong\mathrm{Hom}_R(M_1,-)\times\mathrm{Hom}_R(M_2,-)$ as functors $\mathrm{Mod}_R\to\mathrm{Ab}$. Now, a product of functors is exact iff all the functors involved are exact. This is essentially immedate from the proposition in this question, which is not hard to prove by checking things on elements. (And I gave in there also a proof which tries to avoid elementwise arguments as much as possible.)
Edit: for a proof using that a module is free if it has left lifting against surjections, we first prove that if $M_1$ and $M_2$ are both projective, so is their sum $M_1\oplus M_2$. Suppose given a surjection $g\colon N\twoheadrightarrow N'$, and a map $h\colon M_1\oplus M_2\to N'$. Such a map $h$ is of the form $h(m_1,m_2)=h_1(m_1)+h_2(m_2)$ for some $h_i\colon M_i\to N'$. Since $M_1$ and $M_2$ are projective, we can lift either $h_i$ to a map $\widetilde{h}_i\colon M_i\to N$ such that $g\widetilde{h}_i=h_i$. Define $\widetilde{h}\colon M_1\oplus M_2\to N, (m_1,m_2)\mapsto \widetilde{h}_1(m_1)+\widetilde{h}_2(m_2)$. Then this is an $R$-linear map, and $g\widetilde{h}=h$. Therefore, $M_1\oplus M_2$ is projective.
Conversely, if $M_1\oplus M_2$ is projective, we will prove that $M_1$ is projective. For a surjection $g\colon N\twoheadrightarrow N'$ and a map $h\colon M_1\to N'$, we define a map $p_1\colon M_1\oplus M_2\to M_1, (m_1,m_2)\mapsto m_1$ and consider the composition $k:=hp_1\colon M_1\oplus M_2\to N'$. We can lift this to a map $\widetilde{k}\colon M_1\oplus M_2\to N$ such that $g\widetilde{k}=k$, because $M_1\oplus M_2$ is projective. Now put $\widetilde{h}\colon M_1\to N, m_1\mapsto \widetilde{k}(m_1,0)$. Then $g\widetilde{h}(m_1)=g\widetilde{k}(m_1,0)=hp_1(m_1,0)=h(m_1)$, so $\widetilde{h}$ is the desired lift that shows that $M_1$ is projective.