Here, divisible abelian group $G$ is defined such that for every $y\in G$ and nonzero integer $n$, we have $x\in G$ with $nx=y$.
I am looking for an example where the direct product of groups is divisible but the direct sum is not. I only know the direct product of copies $\mathbb{Q}$, which does not satisfy because the direct sum is also divisible.
Here, the direct sum is subset of direct product whose elements are those with finitely many nonzero components.
Thanks in advance.
There is no such example:
Let $G=\prod_{i\in I}G_i$ be a divisible direct product and $H\le G$ be the direct sum. For $g\in G$ denote by $\psi_i(g)$ the component of $G$ in $G_i$.
Fix $y\in H$ and $n\in\mathbb{Z}\setminus\{0\}$. As $y\in G$ there is some $x\in G$ with $y=nx$. In particular $\psi_i(y)=n\psi_i(x)$.
But $\psi_i(y)$ is non-zero for only finitely many $i$. Define $z\in H$ by $\psi_i(z)=\psi_i(x)$ if $\psi_i(y)\ne 0$ and $\psi_i(z)=0$ if $\psi_i(y)=0$.
In particular $y=nz$. Hence $H$ is divisible.