Is there something called direct sum in the category of unital rings?
The earliest use of the phrase "direct sum" that can be located (today) on MathSciNet is in the paper:
Subrings of Direct Sums by
Neal H. McCoy,
American Journal of Mathematics,
Vol. 60, No. 2 (Apr., 1938), pp. 374-382.
The definition given for a direct sum of rings is:
"If $K$ is any ring, a direct sum of rings $K$ is understood to be the ring of all functions with values in $K$, defined on some finite
or infinite set $M$." Under this definition, $R$ is a direct sum of copies of $K$ if it is a subring of $K^M$ for some $M$.
Within a short time "direct sum" was being used as a synonym for "direct product" in the case of finitely many factors, e.g. in
Dyer-Bennet, John
A note on finite regular rings.
Bull. Amer. Math. Soc. 47, (1941). 784-787.
Nowadays it seems that ring theorists still use direct sum as a synonym for direct product in the case where there are finitely many factors.
if the answer is no, what is the coproduct of (unital) rings?
For an equationally definable class of algebras, the forgetful functor creates products, which implies that the definition of product in such a category does not change when you enlarge or shrink the category. But the forgetful functor does not create coproducts. The construction of coproducts depends on the context. In the category of commutative unital rings, the coproduct of $R$ and $S$ is $R\otimes_{\mathbb Z} S$. In the category of all unital rings it is something different.
One way to deal with coproducts in equational definable categories of algebras is through presentations. If $A$ is presented by $\langle G\;|\;R\rangle$, $B$ is presented by $\langle H\;|\;S\rangle$ and $G\cap H=\emptyset$, then $A\sqcup B$ has presentation $\langle G\cup H\;|\;R\cup S\rangle$.
Also, is valid the notion of subdirect product in rings with unity?
Yes, a subobject of a product is subdirect if it projects onto any coordinate.
is there a book where I can study these topics?
Bergman, Clifford, Universal algebra. Fundamentals and selected topics. Pure and Applied Mathematics (Boca Raton), 301. CRC Press, Boca Raton, FL, 2012.
Dauns, John,
Modules and rings. Cambridge University Press, Cambridge, 1994.
$$A\oplus\bigoplus_{n=1}^M A_i= R$$
then the map $A\to R$ with $a\mapsto (a, 0,0,0,\ldots , 0)$ seems injective to me. Also "its direct sum" doesn't make sense since individual rings don't have direct sums, that's something about an aggregate of rings.
– Adam Hughes Oct 17 '16 at 16:24