The apparent issue comes from your statement of the Universal Property, and by clarifying that statement, we will see that the issue resolves itself.
In a fixed category $\mathcal{C}$, we define the Coproduct of two objects $A$ and $B$ to be
- an object $A + B$
- $\iota_A : A \to A+B$
- $\iota_B : B \to A+B$
satisfying the following Universal Property:
For all pairs of maps $\varphi : A \to C$, $\psi : B \to C$, there is a unique map
$\varphi + \psi : A + B \to C$ so that
- $\varphi = (\varphi + \psi) \circ \iota_A$
- $\psi = (\varphi + \psi) \circ \iota_B$
Now, in the category of Abelian Groups (Ab), one can check that $A \oplus B$ is the coproduct of $A$ and $B$ (interestingly, it is also the product). However, the direct product of two groups does not satisfy the universal property of the coproduct. Indeed, that is why we don't call it a direct sum anymore.
I encourage you to work out the following example to see why this isn't the case:
Let $\mathfrak{S}_3$ be the symmetry group on $3$ letters.
- $\varphi : \mathbb{Z} \to \mathfrak{S}_3$ sending $1 \mapsto (1 2)$
- $\psi : \mathbb{Z} \to \mathfrak{S}_3$ sending $1 \mapsto (2 3)$
- yet there is no map $\varphi + \psi : \mathbb{Z} \oplus \mathbb{Z} \to \mathfrak{S}_3$ satisfying the above condition.
The issue, I'm sure you'll find, is that $(1,0)$ and $(0,1)$ commute in $\mathbb{Z} \oplus \mathbb{Z}$, but their images under $\varphi$ and $\psi$ don't commute in $\mathfrak{S}_3$.
But the universal property as you stated in your question restricts the codomain to be abelian groups, which completely sidesteps this problem. If we are only working with abelian groups, this is great! But in the category of all groups, such arbitrary restrictions on the codomain aren't allowed.
Hope is not lost, though! There is a coproduct in the category of all groups. It is called the free product, and is extremely interesting, though I'm afraid this answer is already getting a bit long.
As a parting word, there is also categorical justification for your observation that, when restricting the codomain to abelian groups, the direct sum approach stil works. Using only group theory, one could verify that the direct sum of abelianizations of groups is the same thing as the abelianization of their free product. At a slightly higher level of abstraction, the abelianization "functor" is a left adjoint. As such, it preserves coproducts, as you have noticed.
I hope this helps ^_^
This answer here is solely for the purpose of giving this question an answer. Since the OP obtained the desired answer (see the comments under the question), I am providing a different way using category theory to show that $$P:=\frac{\prod\limits_{\alpha\in J}\,A_\alpha}{\prod\limits_{\alpha\in J}\,B_\alpha}\cong \prod_{\alpha\in J}\,\frac{A_\alpha}{B_\alpha}\text{ and }S:=\frac{\bigoplus\limits_{\alpha\in J}\,A_\alpha}{\bigoplus\limits_{\alpha\in J}\,B_\alpha}\cong \bigoplus_{\alpha\in J}\,\frac{A_\alpha}{B_\alpha}\,.$$
Explicit isomorphisms can be seen in (*) and (#).
For each $\beta \in J$, $\iota_\beta:A_\beta\to \bigoplus\limits_{\alpha\in J}\,A_\alpha$ and $\pi_\beta: \prod\limits_{\alpha\in J}\,A_\alpha\to A_\beta$ denote the canonical injection and the canonical projection, respectively. Let $q:\bigoplus\limits_{\alpha\in J}\,A_\alpha\to S$ be the quotient map. Then, $q\circ \iota_\beta$ vanishes on $B_\beta$. Therefore, $q\circ \iota_\beta$ factors through the quotient map $q_\beta:A_\beta\to\dfrac{A_\beta}{B_\beta}$. In other words, there exists a (unique) map $i_\beta:\dfrac{A_\beta}{B_\beta}\to S$ such that $$q\circ \iota_\beta=i_\beta\circ q_\beta\,.$$
We claim that $S$ together with the maps $i_\beta:\dfrac{A_\beta}{B_\beta}\to S$ for $\beta\in J$ is a categorical coproduct (direct sum) of the family $\left(\dfrac{A_\alpha}{B_\alpha}\right)_{\alpha\in J}$. Let $T$ be any $R$-module together with morphisms $\tau_\beta:\dfrac{A_\beta}{B_\beta}\to T$ for each $\beta\in J$. We want to show that a there exists a unique morphism $\phi:S\to T$ such that $\phi\circ i_\beta=\tau_\beta$ for each $\beta\in J$.
We define
$$\phi\left((a_\alpha)_{\alpha\in J}+\bigoplus_{\alpha\in J}\,B_\alpha\right):=\sum_{\alpha\in J}\,\tau_\alpha\left(a_\alpha+B_\alpha\right)\text{ for all }(a_\alpha)_{\alpha\in J}\in\bigoplus_{\alpha\in J}\,A_\alpha\,.$$
It is easy to verified that $\phi$ is a well defined morphism, and it is the only morphism such that $\phi\circ i_\beta=\tau_\beta$ for all $\beta\in J$. We can now then conclude that $S$ is a coproduct of the family $\left(\dfrac{A_\alpha}{B_\alpha}\right)_{\alpha\in J}$. Since coproducts are unique up to isomorphism, we obtain $S\cong \bigoplus\limits_{\alpha \in J}\,\dfrac{A_\alpha}{B_\alpha}$, via the isomorphism $\sigma:S\to \bigoplus\limits_{\alpha \in J}\,\dfrac{A_\alpha}{B_\alpha}$ given by
$$\sigma\left((a_\alpha)_{\alpha\in J}+\bigoplus_{\alpha\in J}\,B_\alpha\right):=\sum_{\alpha\in J}\,\bar{\iota}_\alpha\left(a_\alpha+B_\alpha\right)\text{ for all }(a_\alpha)_{\alpha\in J}\in\bigoplus_{\alpha\in J}\,A_\alpha\,,\tag{*}$$
where $\bar{\iota}_\beta:\dfrac{A_\beta}{B_\beta}\to \bigoplus\limits_{\alpha\in J}\,\dfrac{A_\alpha}{B_\alpha}$ is the canonical injection for each $\beta\in J$.
Observe now that, for every $\beta\in J$, $q_\beta\circ \pi_\beta$ vanishes on $\prod\limits_{\alpha\in J}\,B_\alpha$. Therefore, $q_\beta\circ\pi_\beta$ factors through the quotient map $k:\prod\limits_{\alpha\in J}\,A_\alpha\to P$. Ergo, there exists a (unique) morphism $\varpi_\beta:P\to \dfrac{A_\beta}{B_\beta}$ such that $$q_\beta\circ\pi_\beta=\varpi_\beta\circ k\,.$$ We claim that $P$ together with the morphisms $\varpi:P\to \dfrac{A_\beta}{B_\beta}$ is a categorical product (direct product) of the family $\left(\dfrac{A_\alpha}{B_\alpha}\right)_{\alpha\in J}$. Let $Q$ be any $R$-module together with morphisms $\kappa_\beta:Q\to\dfrac{A_\beta}{B_\beta}$ for all $\beta\in J$. We need to show that there exists a unique morphism $\psi:Q\to P$ such that $\varpi_\beta\circ \psi=\kappa_\beta$ for all $\beta\in J$.
We define
$$\psi\left(x\right):=\big(\kappa_\alpha(x)\big)_{\alpha\in J}+\prod_{\alpha\in J}\,B_\alpha\text{ for all }x\in Q\,.$$
It is easily seen that $\psi$ is a well defined morphism, and it is the only morphism such that $\varpi_\beta\circ \psi=\kappa_\beta$ for all $\beta\in J$. We now conclude that $P$ is indeed a product of the family $\left(\dfrac{A_\alpha}{B_\alpha}\right)_{\alpha\in J}$. Since products are unique up to isomorphism, we have $P\cong \prod\limits_{\alpha\in J}\,\dfrac{A_\alpha}{B_\alpha}$ via the isomorphism $\varsigma: \prod\limits_{\alpha\in J}\,\dfrac{A_\alpha}{B_\alpha}\to P$ given by
$$\varsigma\Big(\big(a_\alpha+B_\beta\big)_{\alpha\in J}\Big):=\big(a_\alpha\big)_{\alpha\in J}+\prod_{\alpha\in J}\,B_\alpha\text{ for all }\big(a_\alpha\big)_{\alpha\in J}\in \prod_{\alpha\in J}\,A_\alpha\,.\tag{#}$$
Best Answer
I will assume the groups are discrete, as it simplifies some of the proof. Note that if you don't assume anything then you can not use the Pontryagin duality (you need at least that the groups are locally compact).
Let $\chi$ be a character of $\bigoplus_{i\in A} M_i$. For each $i\in A$, let $\varphi_i:M_i\rightarrow \bigoplus_{i\in A} M_i$ be the natural embedding (i.e. if $A=\{1,2,..\}$ then $\varphi_1(m) = (m,0,0,...)$, $\varphi_2(m)=(0,m,0,0...)$)
Then the map $\chi\circ\varphi_i \in \hat M_i$.
Now let $\varphi: \widehat{\bigoplus_{i\in A} M_i} \rightarrow \prod_{i\in A} \widehat{M_i}$ denote the map $\varphi(\chi) = (\chi\circ \varphi_i)_{i\in A}$.
We will now prove that $\varphi$ is an isomorphism of topological groups.
$\varphi$ is injective:
Let $\chi$ be so that $\chi\circ\varphi_i=0$ for all $i\in A$. Let $m\in \bigoplus_{i\in A} M_i$ and write $m = m_1+...+m_k$ where $m_i = \varphi_i(n_i)$ for some $n_i\in M_i$ and $k\in\mathbb{N}$. Then $\chi(m) = \sum_{i=1}^k \chi\circ\varphi_i (m_i) = 0$. It follows that $\chi=0$.
$\varphi$ is surjective:
Let $(\chi_i)_{i\in A}\in \prod_{i\in A} \widehat{M_i}$, we define a character $\chi:\bigoplus_{i\in A} M_i$ by $$\chi(m) := \sum_{i=1}^\infty \chi_i(\varphi_i(m_i))$$ where $m=(\varphi_i(m_i))_{i\in A}$. Note that this sum is in fact a finite sum because all but finitely many of the values of $\chi_i(\varphi_i(m_i))$ are zero. By construction $\varphi(\chi) = (\chi_i)_{i\in A}$.
It is left to show that $\varphi$ is a homeomorphism. Since $M_i$ are discrete, the Pontryagin dual is compact, by Tychonoff the product of compact groups is compact. Since these groups are also Hausdorff it suffices to prove that $\varphi$ is continuous.
A basis open set in $\prod_{i\in A} \widehat{M_i}$ is of the form $U = U_{a_1}\times...\times U_{a_k} \times \prod_{i\in A \backslash \{a_1,...,a_k\}} \widehat{M_i}$ where $a_1,...,a_k\in A$ and $k\in \mathbb{N}$.
The pre-image of $U$ under $\varphi$ is all $\chi\in \widehat{\oplus_{i\in A} M_i}$ so that $\chi\circ\varphi_{a_i} \in U_{a_i}$ for all $1\leq i \leq k$.
This is a finite intersection of the sets $B_i:=\{\chi\in \widehat{\oplus_{i\in A} M_i} : \chi\circ\varphi_{a_i} \in U_i\}$.
Since $\varphi_{a_i}:M_i\rightarrow \oplus_{i\in A} M_i$ is continuous, its dual $\widehat{\varphi}_{a_i} : \widehat{\oplus_{i\in A} M_i}\rightarrow \widehat{M_i}$ defined by $\chi\mapsto \chi\circ \varphi_i$ is also continuous. Therefore, $B_i$ is open and the claim follows.
If you want me to elaborate on something please let me know.