Module generated by set $S$ Let's denote the free $R$-module generated by a set $S \subset M$ where $M$ is a module by $\langle S \rangle$. Then this is by definition the intersection of all modules $N \subset M$ containing $S$. 
I'd like to show that $$\langle S \rangle = \{ \sum_{k = 1}^n r_k s_k : r_k \in R, s_k \in S \}$$
The inclusion $\supset$ is obvious: if $x = \sum_{k = 1}^n r_k s_k $ then clearly $x$ is in every module $M$ with $S \subset M$. Hence $x \in \langle S \rangle$.
Now for some reason the other inclusion is not obvious to me. Let $x \in \langle S \rangle$. Then $x$ is in every module $N \subset M$ with $S \subset N$. How do I proceed from here?
Edit I made a mistake when I wrote this question. The module generated by $S$ is only free if $S$ is finite. Right?
 A: Hint: Show that $\left\{\sum^n_{k=1}r_ks_k:r_k\in R,s_k\in S\right\}$ is an $R$-module containing $S$. Then if $x\in\langle S\rangle$, it must also be in this set.
A: You seem to be confusing the notions of free module, basis, generating set, and submodule generated by a set.
Submodule generated by a subset, and generating sets
Let $M$ be a given module, and let $S\subseteq M$ be a subset of $M$. We define the submodule of $M$ generated by $S$, denoted by $\langle S\rangle$, as the smallest submodule of $M$ that contains $S$. Equivalently, since the intersection of an arbitrary family of submodules of $M$ is again a submodule of $M$, we can define
$$\langle S\rangle = \bigcap_{N\leq M, S\subseteq N} N,$$
where the intersection is over all submodules of $M$ that contains $S$. 
Note that his definition is taking place in the context of a given module $M$. We are always staying inside the module $M$. The intersection is the intersection of all submodules of $M$ that contain $S$. We are only considering elements and modules that are contained in $M$ and have structure compatible with $M$.
Now, the above is the "top-down" description of the submodule generated by $M$. As usual in this situation (see link above), we also want a "bottoms up" description of $\langle S\rangle$. That is provided by the following, which is, I believe, what you are actually trying to prove:
Theorem. Let $M$ be a $R$-module, and let $S\subseteq M$ be a subset. Then $\langle S\rangle$ consists exactly of all elements of $M$ of the form
$$\sum_{i=1}^n r_is_i,$$
for some $s_1,\ldots,s_n\in S$ and $r_1,\ldots,r_n\in R$.
Proof. Let $T$ be the set of all such elements of $M$.
Note that if $N$ is any submodule of $M$ such that $S\subseteq N$, then we will necessarily have $T\subseteq N$; indeed, let $x\in T$. Then there exist $s_1,\ldots,s_n\in S$ and $r_1,\ldots,r_n\in R$ such that $x = r_1s_1+\cdots + r_ns_n$. Since $S\subseteq N$ by assumption, we have $s_1,\ldots,s_n\in N$. Since $N$ is a submodule, we must also have $r_1s_1+\cdots + r_ns_n\in N$. Thus, $x\in N$, and we have shown that $T\subseteq N$.
That means that $T$ is contained in $\langle S\rangle$: because $\langle S\rangle$ is an intersection, and $T$ is contained in every set that is being intersected. So $T\subseteq \langle S\rangle$.
In order to show that $\langle S\rangle\subseteq T$, it is enough to show that the set $T$ is a submodule of $M$ that contains $S$. Because if this is indeed the case, then $T$ will be one of the sets being intersected in the definition of $\langle S\rangle$, and therefore $\langle S\rangle$ will necessarily be contained in $T$.
So we want to show that $T$ is a submodule of $M$. It is contained in $M$ because $M$ is a module, $S\subseteq M$, so whenever $s_1,\ldots,s_n\in S$ and $r_1,\ldots,r_n\in R$, we will have $r_1s_1+\cdots+r_ns_n\in M$. $T$ is not empty, since the sum with no summands (when $n=0$) is, by definition, equal to $0$, the identity element of $M$. (If $S\neq\varnothing$, then you can also conclude that $T\neq\varnothing$ by taking $n=1$, $s_1\in S$ arbitrary, and considering the sum with $r_1=0_R$, the zero of $R$). 
Now suppose that $x$ and $y$ are elements of $T$, and that $r\in R$. We want to show that $x-ry\in T$. If we can do that, this will prove that $T$ is a submodule of $M$. Since $x\in T$, there exist $s_1,\ldots,s_n\in S$ and $r_1,\ldots,r_n\in R$ such that $x=r_1s_1+\cdots+r_ns_n$. Since $y\in T$, there exist $s'_1,\ldots,s'_m\in S$ and $r'_1,\ldots,r'_m\in R$ such that $y=r'_1s'_1+\cdots + r'_ms'_m$. The only thing we know about the sets $\{s_1,\ldots,s_n\}$ and $\{s'_1,\ldots,s'_m\}$ is that they are contained in $S$; they could be equal, disjoint, one could be contained in the other, or none of the above. Note that the definition of $T$ just says that there are some elements of $S$ that have a certain property, it places no conditions on those elements (not even them being distinct!) other than being contained in $S$.
Now we have:
$$\begin{align*}
x-ry &= \Bigl( r_1s_1+\cdots+r_ns_n\Bigr) -r\Bigl( r'_1s'_1+\cdots + r'_ms'_m\Bigr)\\
&= r_1s_1 + \cdots + r_ns_n + (-rr'_1)s'_1 + \cdots + (-rr'_m)s'_m.
\end{align*}$$
This is an element of $T$: we have $s_1,\ldots,s_n,s'_1,\ldots,s'_m$ are elements of $S$, $r_1,\ldots, r_n, -rr'_1,\ldots,-rr'_m$ are elements of $R$, and we are taking the corresponding sum of multiples of elements of $S$. Thus, $x-ry\in T$ when $x,y\in T$ and $r\in R$. So $T$ is a submodule of $M$.
Finally, we need to show that $S\subseteq T$. Indeed, if $s\in S$, then taking $n=1$, $r_1=1_R$, and $s_1=s$, we get $s = r_1s_1\in T$. 
So $T$ is a submodule of $M$ that contains $S$. Therefore, we have:
$$\langle S\rangle = \bigcap_{N\leq M, S\subseteq N} N = T\cap\bigcap_{N\leq M, S\subseteq N} N \subseteq T,$$
so $\langle S\rangle \subseteq T$. Since we already have shown that $T\subseteq \langle S\rangle$, we conclude that $T=\langle S\rangle$, as desired. $\Box$
A few things to notice:


*

*The definition of $T$ places no restrictions on the size of $S$. We do not require the sum expression to "use" all elements of $S$, just some. If $S$ is finite, we could describe every element of $T$ in terms of all elements of $S$, but we don't have to. 

*The definition of $T$ places no restrictions on the elements $s_1,\ldots,s_n$ that are used to express an element of $T$, except that they must be elements o. They could be the same element, repeated $n$ times, or all distinct; or some repeated, or none. 
Now: given a module $M$ and a subset $S\subseteq M$, we say that $S$ generates $M$ if and only if $\langle S\rangle = M$. 
If $M$ is a module, and $S\subseteq M$, then $S$ always generates  $\langle S\rangle$. Every module has a generating set; in fact, many. We can always take $S=M$; generating sets are not, in general, unique: if $S$ generates $M$, and $S\subseteq S'\subseteq M$, then $S'$ also generates $M$. And there may not be a "smallest" generating set, or even "minimal" generating sets. Sometimes there are, sometimes there are not. 
Bases
Bases are special types of generating sets.
Let $M$ be a module. A subset $B\subseteq M$ of $M$ is a basis for $M$ if and only if it satisfies two conditions:


*

*$B$ generates $M$; that is, $\langle B\rangle = M$; and

*$B$ is "independent": if $b_1,\ldots,b_n$ are any finite set of pairwise distinct elements of $B$, and $r_1,\ldots,r_n$ are elements of $R$ such that
$$r_1b_1+\cdots+r_nb_n = 0,$$
then $r_1=r_2=\cdots=r_n=0$.


Again, note that this is all taking place in the context of a given module. There are several equivalent ways of saying $B$ is a basis; for example, you can say that $B$ is a basis if and only if every element of $M$ can be expressed uniquely as a sum of nonzero multiples of finitely many elements of $B$. A basis may or may not exist for any given module $M$.
Free modules and free generating sets
Let $X$ be a set. A module $M$ is said to be a free module on $X$ if and only if $X\subseteq M$ and $M$ satisfies the following condition:


*

*Given any module $N$ and any (set-theoretic; that is, not necessarily a module homomorphism) function $f\colon X\to M$, there exists a unique moudle homorphism $\mathcal{F}\colon M\to N$ such that $\mathcal{F}(x) = f(x)$ for all $x\in X$. 


We have the following result (which is where, I think, you got confused):
Theorem. Let $M$ be a module, and let $X\subseteq M$. Then $M$ is a free module on $X$ if and only if $X$ is a basis for $M$.
Now, given any set $X$ (finite, countable, or infinite, doesn't matter), there always is a "free module on $X$". One can construct it as the set of all formal sums of multiples of elements of $X$, or as a direct sum, or any other number of ways. But here we start with a set, and we construct a module (as opposed ot the notion of "submodule generated", where we start with a module). 
Finally, we say that a module $M$ is free if there exists $X\subseteq M$ such that $X$ is a basis for $M$ (equivalently, such that $M$ is free on $X$). 
Also, given a module $M$ and a subset $X$, if $X$ is independent, then by the theorem above we can conclude that $\langle X\rangle$ is a free module on $X$; this may or may not be equal to all of $M$. But again, here we start with a module, not with a set. 
