Show that any direct sum of free $R$-modules is free. ($R$ has a $1$, of course.)
I have a few questions regarding my partial proof so far, as well as on how to finish the proof.
Let $\{F_i\}_{i\in I}$ be a collection of free $R$-modules.  For each $F_i$, there exists some basis $A_i= \{a_{i,j}\}_{j\in J}$. Let $A:= \bigcup_I A_i$. There is an $R$-module  $F(A)$ which is free on $A$. We may assume WLOG that  $\{F_i\}_{i\in I}$ is pairwise disjoint. (Is this true? I need it for $f$ below to be well-defined.) Define the function $f: A\rightarrow \bigoplus_I F_i$ by $a_{i,j} \mapsto (s_t)_{t\in I}$ where $s_t =1$ if $t= i$ and $0$ otherwise. By the universal property of free modules, there exists a unique $R$-module homomorphism $g: F(A)\rightarrow \bigoplus_I F_i$ defined by $\sum_{i,j=1}^{k}r_{i,j}a_{i,j} =\sum_{i,j=1}^{k} r_{i,j}f(a_{i,j})$. (I don't think I defined this correctly. Do I need a double sum over $i$ and $j$?).
Now, I want to show that $g$ is bijective. I think this should be true, but I'm really lost here in the formal technicalities. How can I do this?
(Also, as a secondary question, how does one prove that module isomorphisms preserve free-ness? I'm actually just taking it for granted right now.)
I'd appreciate some help.
 A: Let me first adress the two details you ask about :


*

*When taking the direct sum $\bigoplus_I F_i$, you are not so much assuming that the $F_i$ are pairwise disjoint than considering that it is the case; by this I mean that even if some of them are really the same (for example if you have something like $R^2\oplus R^2$), you will consider them as different, and have different generators for each (so that the sum $\bigcup_I A_i$ is disjoint).

*In your definition of $g$, you should consider a sum of the form $\sum_{i\in I,j\in J_i}r_{i,j}a_{i,j}$, where all but finitely many of the $r_{i,j}$ are zero. Note that I replaced $J$ by $J_i$, because the $F_i$ could have different number of elements in their respective basis (you could very well have something like $R^2\oplus R^3$.


There is a also a problem with your definition of $f$. What you should do is define it as $f(a_{i,j})=(s_ta_{i,j})_{t\in I}$ (with the same $s_t$). This way you put every generator in the corresponding module.
Now to show bijectivity, you can do it in two steps :


*

*Injectivity : assume $g\left(\sum_{i\in I,j\in J_i}r_{i,j}a_{i,j}\right)=0$. Now
$$g\left(\sum_{i\in I,j\in J_i}r_{i,j}a_{i,j}\right)=\sum_{i\in I}\sum_{j\in J_i}r_{i,j}a_{i,j},$$where the right-hand side is seen as a sum over $i$ of elements of the form $\sum_{j\in J_i}r_{i,j}a_{i,j}\in F_i$. If this is zero, then (by definition of the direct sum) every $\sum_{j\in J_i}r_{i,j}a_{i,j}$ has to be $0$, and since every $F_i$ is free on $A_{J_i}$, every $r_{i,j}$ has to be $0$; hence $\sum_{i\in I,j\in J_i}r_{i,j}a_{i,j}=0$.

*Surjectivity : an element $y\in \bigoplus_I F_i$ must be of the form $y=\sum_i x_i$, where $x_i\in F_i$ and all but finitely many of the $x_i$ are $0$. Now in every $F_i$ we must have $x_i=\sum_{j\in J_i} r_{i,j}a_{i,j}$, again with all but finitely many of $r_{i,j}$ equal to $0$. Thus we have
$$y=\sum_{i\in I}\sum_{j\in J_i} r_{i,j}a_{i,j}=g\left(\sum_{i\in I,j\in J_i} r_{i,j}a_{i,j}\right),$$and thus $g$ is surjective.



All this being said, it is (in my opinion) easier to simply prove that the direct sum $\bigoplus_I F_i$ satisfies the universal property of free modules using the universal property of the direct sum :

For all $R$-module $M$ and all collection of $R$-module homomorphisms $f_i:F_i\to M$, there exists a unique $R$-module homomorphism $f:\bigoplus F_i\to M$ such that $f\circ \sigma_i=f_i$ for all $i\in I$ (where $\sigma_i:F_i\to \bigoplus_{t\in I} F_t$ is defined by $\sigma_i(a)=(s_ta)_{t\in I}$).

Now to prove that the direct sum is a free-module : suppose you are given $h:A\to M$, and denote by $h_i:A_i\to M$ the restrictions of $h$ to each $A_i$. Since every $F_i$ is free, you have for all $i$ a unique $R$-module homomorphism $f_i:F_i\to M$ whose restriction to $A_i$ is $h_i$, and by the universal property of the direct sum this gives you a unique homomorphism $f:\bigoplus_I F_i\to M$. Now $f$ restricted to $A$ is $h$, because every restriction to $A_i$ is given by $h_i$.
