The point is, you have not given your intended map $f$.
I will give it for you
$$
f \left( \begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \right)
=
\begin{bmatrix} b & 0 \\ c & a \\ \end{bmatrix}.
$$
Now just compute to see $f(x y) = f(x) f(y)$.
Alternatively, save some time and effort by noting that
$$
f \left( \begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \right)
=
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} \cdot
\begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \cdot
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix}
$$
and
$$
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix}^{2} = I.
$$
Explicitly,
$$f \left( \begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \right) f \left( \begin{bmatrix} d & e \\ 0 & f \\ \end{bmatrix} \right) = \begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} \cdot
\begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \cdot
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} \cdot
\begin{bmatrix} d & e \\ 0 & f \\ \end{bmatrix} \cdot
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} =\\= \begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} \cdot
\begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \cdot\begin{bmatrix} d & e \\ 0 & f \\ \end{bmatrix} \cdot
\begin{bmatrix} 0 & 1 \\ 1 & 0 \\ \end{bmatrix} = f \left( \begin{bmatrix} a & c \\ 0 & b \\ \end{bmatrix} \cdot \begin{bmatrix} d & e \\ 0 & f \\ \end{bmatrix}\right).$$
As mentioned in a comment, $R_0$ being a subring of $R$ follows from how $R_0R_0\subseteq R_{0+0}$.
As for your question on direct sums, it might be helpful to look at the finite analogue.
Given two abelian groups $R$ and $S$, the direct sum $R\oplus S$ will coincide with (as in, it is isomorphic to) the direct product $R\times S$.
The latter is a cartesian product of abelian groups, so the elements of $R\times S$ are of the form $(r,s)$ for $r\in R$ and $s\in S$, with addition and multiplication done component-wise.
With this notation, saying that an element of $R\times S$ is "in $R$" means that the $S$ component is zero. In other words, $R$ can be identified with the subgroup $\{(r,0)\mid r\in R\}$ of $R\times S$, and similarly for $S$.
Now, saying that an element of $R\times S$ can be written uniquely as a sum of an element of $R$ with an element of $S$ is to say that $(x,y)=(r,0)+(0,s)$ forces $x=r$ and $y=s$, which follows by computing the sum on the right-hand side.
In the infinite setting, this is no longer true for products only because infinite sums don't make sense in abelian groups. For example, you can't decompose $(1,1,1,\dots)\in\prod_{i=0}^\infty\mathbb Z$ into a sum where each summand lies in one of the $\mathbb Z$'s because such a sum would have to be infinite.
If we restrict our attention to the subgroup of $\prod_{i=0}^\infty\mathbb Z$ where we only take those $(x_1,x_2,x_3,\dots)$ where finitely many of the $x_i$ are nonzero, the decomposition is true again: if we let $I$ be the (finite) set of indices $i\in I$ for which $x_i\neq0$, then $(x_1,x_2,x_3,\dots)=\sum_{i\in I}\vec x_i$, where $\vec x_i=(0,\dots,0,x_i,0,\dots)$ is nonzero only in the $i$th index.
In general, the subgroup of $\prod_iR_i$ consisting of those sequences wherein only finitely many terms are nonzero is precisely the direct sum, denoted $\bigoplus_iR_i$. Intuitively, this is the resulting abelian group where you allow elements of the different rings to be added together "freely" (if $r_i\in R_i$ and $r_j\in R_j$, then $r_i+r_j$ only really makes sense if $i=j$; if $i\neq j$, then we don't know what to do, so just let their sum be this new element called $r_i+r_j$). In this way, it is essentially by definition that elements of $\bigoplus_iR_i$ are uniquely given by finite sums of elements in the individual $R_i$'s.
In fact, your disjointness of direct summands from linear algebra is still valid for direct sums of abelian groups: if you identify $R_j$ with the subgroup of $\bigoplus_iR_i$ consisting of those elements whose only nonzero term is at index $j$, then $R_i\cap R_j=\{0\}$ whenever $i\neq j$.
Best Answer
To get a ring, let $A $ the set of $$\sum_{i=1}^r (a_i\sin (n_ix)+b_i\cos (m_ix)) $$ with $a_i,b_i\in\Bbb Q $ and $n_i,m_i\in\Bbb N$. Then $A $ is closed respect to sum. Closuresness respect to product follows by Werner formulas.