Non-unital rings: a few examples Every ring I've ever heard of is unital, i. e., contains a (unique) element $a$ such that $xa = ax = x$ for every $x$ in it. However, some rings do not have such an element. What are they?
P. S.: one will notice I assumed commutativity. So, for an easier related request, some examples of non-commutative rings would also be appreciated.
 A: A simple example would be the ring of ($ n \times n $)-matrices over $ 2 \mathbb{Z} $. This is a non-commutative ring without an identity.
A: One general source of such examples is functional analysis. 
One of the easiest examples to describe is the space $C_{0}{(X)}$ of functions vanishing at infinity, where $X$ is locally compact, with pointwise addition and multiplication as operations. This ring is commutative and it is unital if and only if $X$ is compact.
Another class of examples is formed by the convolution algebra $L^{1}(G)$ of a locally compact group $G$. It is unital if and only if $G$ is discrete and it is commutative if and only if $G$ is commutative. So probably the easiest examples of this kind would be $L^{1}(\mathbb{R})$ or $L^{1}(\mathbb{S^1})$. Related but a bit more complicated are the group $C^{\ast}$-algebras.
A completely different kind of (non-commutative) example would be the algebra of compact operators of an infinite-dimensional Banach space.
A: A ring is called generalized Boolean if $a^2 = a$ for every element $a$.
It can be easily proved that a generalized Boolean ring is commutative and $a + a = 0$ for every element $a$.
A generalized Boolean ring with a unity is called a Boolean ring.
As will be shown below, a Boolean ring can be identified with a Boolean algebra.
It is well known, by Stone's representation theorem, that a Boolean algebra corresponds canonically to a compact totally disconnected space.
I will explain that a generalized Boolean ring corresponds canonically to a locally compact totally disconnected space.
Let $B$ be a lattice, i.e. a partially ordered set in which any two elements have a supremum and an infimum. $B$ is called a generalized Boolean algebra if it satisfies the following conditions.
(1) $B$ has a least element $0$.
(2) Let $a, b, c$ be elements of $B$.
$a\cap(b\cup c) = (a\cap b)\cup (a\cap c)$
$a\cup (b\cap c) = (a\cup b)\cap (a\cup c)$
(3) Let $a \in B$. there exists $b'$ such that $b\cap b' = 0, b\cup b' = a$ for every $b \le a$
A Boolean algebra is characterized as a generalized Boolean algebra with a greatest element(denoted by $1$).
The following is a typical example of a generalized Boolean algebra.
Let $X$ be a set.
Let $\Phi$ be a non-empty subset of the power set $P(X)$.
$\Phi$ is called a ring of sets on $X$ if it satisfies the following conditions.
Let $A, B$ be arbitrary elements of $\Phi$.
(1) $A\cup B \in \Phi$.
(2) $A \backslash B \in \Phi$.
Then $\Phi$ is a generalized Boolean algebra with the inclusion order.
Let $B, C$ be generalized Boolean algebra.
Let $f\colon B \rightarrow C$ be a map.
$f$ is called a homomorphism if it satisfies the following properties.
$f(a\cup b) = f(a) \cup f(b)$
$f(a\cap b) = f(a) \cap f(b)$
$f(0) = 0$
When $B$ and $C$ are Boolean algebras, $f$ is called a homomorphism of Boolean algebras if $f(1) = 1$.
Let $B$ be a generalized Boolean algebra.
Let $a, b \in B$.
There exists $c \in B$ such that $a \le c, b \le c$(for example $c = a \cup b$).
There exists $b' \in B$ such that $b\cap b' = 0, b\cup b' = c$.
It can be proved that $a\cap b'$ does not depend on a choice of $c$.
We denote $a \cap b'$ by $a \backslash b$.
We denote $(a\backslash b)\cup(b\backslash a)$ by $a\triangle b$ and call it the symmetric difference of $a$ and $b$.
It can be easily proved that $B$ is a generalized Boolean ring with addition $\triangle$ and multiplication $\cap$.
Conversely let $A$ be a generalized Boolean ring.
We denote $a \le b$ if $ab = a$.
It can be easily proved that this is an order relation and $A$ is a generalized Boolean algebra with this order.
Let $GBoolRng$ be the category of generalized Boolean rings(the morphisms are homomorphisms).
Let $GBoolAlg$ be the category of generalized Boolean algebras(the morphisms are homomorphisms).
Let $\mathcal{Set}$ be the category of small sets.
Let $U\colon GBoolRng \rightarrow \mathcal{Set}$, 
Let $V\colon GBoolAlg \rightarrow \mathcal{Set}$ be the canonical functors(i.e. the forgetful functors).
By the above results, we get a functor $F\colon GBoolRng \rightarrow GBoolAlg$ and a functor $G\colon GBoolAlg \rightarrow GBoolRng$.
It is easy to see that $U = VF, V = UG, GF = 1, FG = 1$.
Hence we can identify a generalized Boolean ring with a generalized Boolean algebra.
It can be easily seen that there exists a similar result concerning Boolean rings and Boolean algebras.
Let $A$ be a generalized Boolean algebra.
Let $F_2$ be the two element Boolean algebra.
A homomorphism $\chi\colon A \rightarrow F_2$ is called a character of $A$ if $\chi \neq 0$.
We denote by $X(A)$ the set of characters of $A$.
Let $F_2^{A}$ be the set of maps $A \rightarrow F_2$.
We consider $F_2^{A}$ as a topological space with the product topology, where $F_2$ is endowed with discrete topology.
We consider $X(A)$ as a topological space with the subspace topology induced by $F_2^{B}$.
It can be proved that $X(A)$ is a locally compact totally disconnected Hausdorff space.
Let $S(X(A))$ be the set of compact open subsets of $X(A)$.
It is easy to see that $S(X(A))$ is a generalized Boolean algebra with the inclusion order.
Then the following theorem holds.
Generalized Stone's representation theorem
Let $A$ be a generalized Boolean algebra.
For $a \in A$, we denote by $a^*$ the set $\{\chi\in X(A)\colon \chi(a) = 1\}$.
Then $a^* \in S(X(A))$.
We define a map $\rho\colon A \rightarrow S(X(A))$ by $\rho(a) = a^*$.
Then $\rho$ is an isomorphism of generalized Boolean algebras.
A: Here is an example which comes up occasionally for me: Let $C$ be a category and $k$ a field. Define the "category algebra" $kC$ to be the free vector space on $\bigsqcup_{X,Y \ \in \mathrm{Ob}(C)} \mathrm{Hom}_C(X,Y)$, with multiplication $\alpha \beta = \alpha \circ \beta$ if the target of $\beta$ is the source of $\alpha$, and $0$ otherwise. (So this generalizes the group algebra of a group and the path algebra of a quiver.) If $\mathrm{Ob}(C)$ is finite, then $\sum_{X \in \mathrm{Ob}(C)} \mathrm{Id}_X$ is the identity but, if there are infinitely many objects, there is no identity.
A: Any ideal in a ring is itself a ring (but generally without unity, unless it's the full ring). So, there are plenty of examples.
A: Non-unital rings are employed heavily in the general study of radical theories for rings. Perhaps you will find the following remarks of interest, excerpted from the preface of Gardner and Wiegandt: Radical Theory of Rings, 2004.

Some authors deal exclusively with rings with unity element. This assumption is all right and not restrictive, if the ring is ﬁxed, as in module theory or group ring theory or sometimes investigating polynomial rings and power series rings (if the ring of coefficients does not possess a unity element. the indeterminate x is not a member of the polynomial ring). Dealing, however, simultaneously with several objects in a category of rings, demanding the existence of a unity element leads to a bizarre situation. Rings with unity element include among their fundamental operations the nullary operation $\mapsto$ 1 assigning the unity element. Thus in the category of rings with unity element the morphisms, in particular the monomorphisms, have to preserve also this nullary operation: subrings (i.e. subobjects) have to contain the same unity element, and so a proper ideal with unity element is not a subring, although a ring and a direct summand; there are no inﬁnite direct sums, no nil rings, no Jacobson radical rings, the ﬁnite valued linear transformations of an inﬁnite dimensional vector space do not form a ring, etc. Thus, in many, maybe most, branches of ring theory the requirement of the existence of a unity element is not sensible, and therefore unacceptable. This applies also to radical theory. and so in this book rings need not have a unity element.

For a somehwat different viewpoint see Bjorn Poonen's Why all rings should have a 1.
