Can non-unital rings be replaced by R-algebras? While working through some lecture notes on semigroups, it seemed to me like a semigroup doesn't buy you much generality over a monoid. But I wondered whether the situation is different for non-unital versus (unital) rings. Then I worked through the following reasons against non-unital rings, which made the point that all naturally occurring non-unital (sub)rings actually have important additional structures, giving ideals and R-algebras as examples. But the author of that paper later later agreed to most of the reasons for non-unital rings.
Let $A$ be a ring (possibly non-unital) and $\tilde{A}=\mathbb Z\oplus A$ as abelian group. I wondered what Martin Brandenburg meant by the "obvious" multiplication so that $A\subseteq \tilde{A}$ is an ideal and $1\in\mathbb Z$ is the identity. After some trying, I came up with
$$ (r,a)\cdot(s,b)=(rs,rb+sa+ab)$$
I haven't checked associativity, but at least the above two conditions are satisfied. Now I wonder what would happen if I replace $\mathbb Z$ by an arbitrary commutative ring $R$ with identity $1$, and assume that I'm also given a scalar multiplication $R \times A \mapsto A$ denoted by $(r, a) \mapsto ra$. Would the above multiplication turn $R\oplus A$ into an (unital) ring, if $A$ is an $R$-algebra? And would conversely $A$ be an $R$-algebra, whenever $R\oplus A$ happens to be an (unital) ring under the above multiplication?
 A: Let R be a unital, associative, possibly non-commutative ring.  A possibly non-unital, non-associative, non-commutative R-algebra is simply an R-R bimodule M and an R-R bimodule homomorphism f from $M\otimes_R M$ to M, where $m\cdot n = f(m\otimes n)$.  The result is a distributive multiplication on M where elements of R act in normal fashions: $mr\cdot sn=m\cdot rsn$, etc.
Then the R-R bimodule $S=R\oplus M$ becomes a unital $R$-algebra using the homomorphism $(r\oplus m) \otimes (s\oplus n) \mapsto (rs \oplus (rn+ms+m\cdot n))$.  If the multiplication on M is associative, then S is an associative, unital R-algebra.  If both R and M are commutative, then S is commutative.

If the multiplication on M is the zero map (the only multilication you can guarantee in general), then you can view this as a (non-unital) R-subalgebra of the triangular R-algebra defined by R, R, and M.
$$S = \left\{\begin{bmatrix} r & m \\ 0 & r \end{bmatrix} : r \in R, m \in M \right\} \qquad \begin{bmatrix} r & m \\ 0 & r \end{bmatrix}\cdot \begin{bmatrix} s & n \\ 0 & s \end{bmatrix} = \begin{bmatrix} rs & rn+ms \\ 0 & rs \end{bmatrix}$$
Triangular rings are very good to produce counterexamples by taking a module property of M and making it a ring property of S.  Lam's Lectures on Modules and Rings has a few good examples.  The "D+M" construction is also a popular use of triangular rings, as in the ring of polynomials with rational coefficients in general, but integral constant coefficients: it behaves like a mix of the ring Z[x] and the Z-module Q[x].

In your question, you have a scalar multiplication $R\times A\to A$.  This multiplication needs to satisfy a few axioms.  Those axioms are precisely that A is an R-module under this multiplication, and that the multiplication map $f:A\otimes A \to A:a\otimes b \mapsto ab$ is an R-R bimodule homomorphism.

A description of this trivial $R\oplus M$ extension was originally given in Dorroh (1932), which is clearly written and in modern enough language.  This preserves basic structural features such as distributivity, associativity, commutativity, and adjoins a multiplicative unity.  However, the elements of M are much closer to an ideal than a large subring, and so properties such as being an integral domain need not hold. For instance if M had a 1, then 
$$(1⊕0 - 0⊕1)(0⊕m) = (0⊕(m+0+0)) - (0⊕(0+0+m)) = 0,$$ and every element of M is a zero-divisor, even if M began life as a nice field.
A few different embeddings are given in Burgess–Stewart (1989) that address some of these problems.  First they find a subring K of End(M) that is as large as possible while still being similar to the “integers” inside M, and then embed both M and K inside End(M) and let S be the ring they both generate.  In this case, elements of S are all of the form km, and so M is "dense" inside S, automatically giving most of the good properties (in the non-commutative world) one would expect from a localization.  For instance, the non-unital ring $2\mathbb{Z}$ is embedded in $\mathbb{Z}$, where the latter is really the ring of endomorphisms of the additive group of $2\mathbb{Z}$.  This works well as long as M has only one multiplicative 0.  In the case where this is not true, they take an approach fairly similar to Dorroh, but using a ring like K instead of $\mathbb{Z}$.
Sometimes (my version of) Dorroh's extension works fairly well.  The version I describe here is also described in Mesyan (2010), where it is shown that these extensions behave well with regards to semi-primeness (similar to a direct product of integral domains), and a similar sounding result is given for primeness (similar to integral domain), though the actual impact is not as great.


*

*Dorroh, J. L.
Concerning adjunctions to algebras.
Bulletin A. M. S. 38, 85-88 (1932).
JFM58.0137.02
DOI:10.1090/S0002-9904-1932-05333-2

*Burgess, W. D.; Stewart, P. N.
The characteristic ring and the “best” way to adjoin a one.
J. Austral. Math. Soc. Ser. A 47 (1989), no. 3, 483–496.
MR1018976
DOI:10.1017/S1446788700033218

*Mesyan, Zachary.
The ideals of an ideal extension.
J. Algebra Appl. 9 (2010), no. 3, 407–431. 
MR2659728
DOI:10.1142/S0219498810003999
ArXiV:0909.0440
A: A counterexample to a claim I erroneously thought someone had made: if $A$ is a left $R$-module, but not necessarily an $R$-algebra, must the Dorroh construction produce an associative algebra?
Let $A=\mathbb{Q}[i]$ and $R=\mathbb{Q}[\sqrt{2}]$, and define an $R$-module structure on $A$ by defining $(r_1+r_2\sqrt{2})\cdot(a_1+a_2i) = (r_1 a_1 + 2 r_2 a_2) + (r_2a_1 + r_1a_2)i$, where $r_1, r_2, a_1, a_2 \in \mathbb{Q}$ are rational numbers with the standard multiplication.
This defines an $R$-module structure on $A$, namely $A$ is a free $R$-module of rank 1, so that ${}_RR \cong {}_RA$ as left $R$-modules, but not as rings.  This also defines both $R$ and $A$ as $\mathbb{Q}$-algebras, since the multiplication when $r_2=0$ or $a_2=0$ is the expected one.
Now we use the formulation in the question to define a multiplication on $R \oplus A$ via
  $$(r,a)\cdot(s,b) = (rs, rb+sa+ab)$$
Now consider the multiplication
$$(0,i) \cdot (0,i) \cdot (\sqrt{2},0)$$
On the one hand, it is supposed to be:
$$((0,i)\cdot(0,i)) \cdot (\sqrt{2},0) = (0,-1) \cdot (\sqrt{2},0) = (0,0+(\sqrt{2}(-1)) + 0 )$$
but the multiplication of $R$ on $A$ defines $\sqrt{2}(-1) = -i$, so we get
$$((0,i)\cdot(0,i)) \cdot (\sqrt{2},0) = (0,-1) \cdot (\sqrt{2},0) = (0,-i)$$
On the other hand, it is supposed to be:
$$(0,i)\cdot((0,i)) \cdot (\sqrt{2},0)) = (0,i) \cdot (0,0+\sqrt{2}(i)+0)$$
but the multiplication of $R$ on $A$ defines $\sqrt{2}(i) = 2$, so we get:
$$(0,i)\cdot((0,i)) \cdot (\sqrt{2},0)) = (0,i) \cdot (0,2) = (0,2i)$$
In particular, the resulting multiplication is not associative.

I misread the question (sorry!).  Suppose $A$ is a left $R$-module so that one does manage to get an associative unital ring structure, must $A$ be an $R$-algebra?
The counterexample is fairly general.  I'll reorder it a little to avoid assuming $R$ is central:
$$(r,0)\cdot((0,a)\cdot(0,b)) = (r,0) \cdot(0,0+0+ab) = (r,0)\cdot(0,ab) = (0,r(ab)+0+0) = (0,r(ab))$$
but 
$$((r,0)\cdot(0,a))\cdot(0,b) = (0,ra+0+0) \cdot(0,b) = (0,ra)\cdot(0,b) = (0,0+0+(ra)b) = (0,(ra)b)$$
so for $R\oplus A$ to be associative, $A$ must be an $R$-algebra, as in, $r(ab) = (ra)b$.
I believe your multiplication will also force $r(ab) = a(rb)$, whereas my multiplication only requires $(ar)b = a(rb)$, so that associative properties follow from associative properties, rather than commutative properties.
Notice that your multiplication can be used to give $A$ an R-R bimodule structure since $m\cdot r$ can be defined as $(0,m)\cdot (r,0) = (0,m\cdot r)$, but then of course $rm=m\cdot r$ and we have the situation common in commutative algebra where the left and right module structures are required to coincide.
