This is written on Page 93 of Derek J.S. Robinson's A Course in the Theory of Groups:
Let $G$ be an arbitrary abelian group, $T$ its torsion-subgroup. For an arbitray prime $p$, denote $G_p$ as the $p$-primary component of $G$. Then $T$ is the sum of all the $G_p$.
Isn't $T$ the direct sum of $G_p$? For any element $a \in T$, $a$ is of finite order. If the order of $a$ equals $p_1^{n_1} \cdots p_k^{n_k}$ where $p_i$'s are primes and $n_i$'s are positive integers. Then there must exist $a_i \in G_{p_i}$, $i=1, \cdots k$, such that $a = \sum_i a_i$. Because if $q \notin \{p_1, \cdots p_k \}$, and a nonzero $b \in G_q$ appears in the summation form of $a$, then the order of $a$ must be divisible by $q$. But in fact it isn't.
In my understanding, a direct sum is like the coproduct in category language, where every element written in the summation form has only finite nonzero components. But a sum can take the sum of infinitely many elements. In fact, picking infinitely elements of $G$, one per $G_p$, and adding them together may get an element of infinite order, lying outside $T$.
Where am I wrong?
Then I considered $\mathbb{Q} / \mathbb{Z}$. What is the sum of inverse of primes $\frac{1}{2} + \frac{1}{3} + \frac{1}{5} + \cdots$? Is it still in $\mathbb{Q}$? The definition of a group $(G, *, 1)$ only says for finitely many $a_i \in G$, $a_1 * \cdots * a_n$ is in $G$; it doesn't guarantee the closedness of $G$ under infinitely many times of applying the operation $*$.
Best Answer
No, a "sum of subgroups $H_i$" is the subgroup generated by the subgroups, which consists only of all finite sums of elements of $\cup H_i$; there is no such thing as "infinite sums" in general groups (you need some notion of convergence in order to talk about infinite sums).
In particular, the abelian group $\mathbb{Q}$ does not contain infinite sums. With repeated application of a binary operation you can get sums with arbitrarily large but finite number of summands, not infinite sums/series.
There are two types of "direct sum". The so-called "External Direct Sum" (which is a subgroup of the direct product, etc), and the so-called "Internal Direct Sum".
An abelian group $G$ is the external direct sum of groups $\{G_i\}_{i\in I}$ if $G$ is exactly the set of $I$-tuples, $\prod_{i\in I}G_i$, with almost all entries trivial.
If, on the other hand, $\{H_i\}_{i\in I}$ are a family of subgroups of $G$ such that $\sum H_i = G$ and $H_i\cap\left(\sum_{j\neq i}H_j\right)=\{0\}$, then $G$ is isomorphic to $\oplus H_i$, but is not actually equal to this direct sum. Then we say that $G$ is the internal direct sum of the $H_i$.
Technically, internal and external direct sums are different types of constructions. Morally and in practice, they are the same, because if $G$ is the internal direct sum of its subgroups $H_i$, then it is isomorphic to the external direct sum of the $H_i$; and the external direct sum of the $H_i$ is an internal direct sum of the subgroups $\mathcal{H}_i$, where $\mathcal{H}_i$ is the subgroup of all elements whose $j$th entries are equal to $0$ for all $j\neq i$. So in practice, the distinction is dropped.
Robinson is perfectly correct in saying that $T$ is the sum of the subgroups (i.e., the subgroup generated by them). You are, also, correct in noting that this sum is in fact "direct" (that is, that $T$ is the internal direct sum of the $p$-torsion parts of $G$). If a group is the internal direct sum of some subgroups, then it is also the sum of these subgroups (the converse does not hold, if there are intersections between the subgroups).