TITLE: A ring $R$ which can be written as a direct sum of two ideals.
QUESTION [5 upvotes]: Let $R$ be a unital associative ring and 
$$
R=A\oplus B,
$$
where $A$ is a two-sided ideal of $R$ and $B$ is a right ideal of $R$. Does it follow that $B$ is a two-sided ideal of $R$?
I feel like the answer should be yes. Say I take an arbitrary element $(r,s)\in R$, I need to show that $(r,s)b\in B$ for all $b\in B$. But an element of $B$ can only be written as $(0,b)$ for some $b\in R$, so 
$$
(r,s)(0,b)=(0,sb)\in B.
$$
I feel like I am missing something and it's not that simple, since I'm not using the fact that $R$ is unital at all. What am I missing here?

REPLY [4 votes]: If writing $R = A\oplus B$ means that $R$ is the direct sum of two additive subgroups $A$ and $B$, and $A$ happens to be a 2-sided ideal while $B$ happens to be a right ideal, then it need not be true that $B$ is a 2-sided ideal. 
Example. $R$ is the ring of upper triangular $2\times 2$ matrices over a field, $A$ is the ideal of $R$ consisting of matrices of the form $\left[\begin{matrix}
*&*\\0&0\end{matrix}\right]$ and $B$ is the right ideal of $R$ consisting of matrices of the form $\left[\begin{matrix}
0&0\\0&*\end{matrix}\right]$.