This is an exercise problem from Graduate Algebra written by Hungerford.
Let $K$ be a ring and $F$ a free $K$-module with a countably infinite basis $\{e_1, e_2, \ldots\}$. Then $R=\hom_K(F,F)$ is a ring, called the endomorphism ring of $F$. Prove that for each positive integer $n$, the free left $R$-module $R$ has a basis of cardinality $n$; that is, as an $R$-module, $R\simeq R\oplus \cdots \oplus R$ for any finite number of summands.
I was thinking that to prove free left $R$-module has a basis of cardinality $n$, we first suppose it does not have a finite cardinality and draw a contradiction? However, I wasn't able to point out the contradiction. Should I approach differently? Any help would be very nice.
Edit: there is a hint in the book. $\{1_R\}$ is a basis of one element; $\{f_1,f_2\}$ is a basis of two elements, where $f_1(e_{2n})=e_n$, $f_1(e_{2n-1})=0$, $f_2(e_{2n})=0$ and $f_2(e_{2n-1})=e_n$. Note that for any $g\in R$, $g=g_1f_1+g_2f_2$ where $g_1(e_n)=g(e_{2n})$ and $g_2(e_n)=g(e_{2n-1})$.