If $R$ is a ring with unity $1$, then $S \subseteq R$ is called a subring if it is itself a ring with $1 \in S$. A subset $I \subseteq R$ is called an ideal if it is a group with respect to addition and $rx, xs \in I$ for each $r,s \in $ and $x \in I$. With these definitions an ideal $I$ is a subring iff $1 \in I$ iff $I = R$, hence there are no proper ideals that are also subrings of $R$.
If we change the definition and look at rings without requiring an identity, then every ideal is also a subring, but not every subring needs to be an ideal. This could be read on wikipedia. There it is also stated that not every ideal has itself an identity, examples as given there are $\mathbb Z$ and $\mathbb Z \times \mathbb Z$, other are in quotient polynomial rings, where ideals have identites, see for example this post.
But lets look at rings with unity from now on. If an ideal has unity, then it is itself a ring with unity, but the identity might be different, and I ask myself it what sense is the ring structure on the ideal then different from the ring structure on the given ring.
What are the conditions that ensure that ideals have identites, and hence form rings by themself? And what is the relation to the original ring? Could we give a ring homomorphism from the ring to the ideal then?
I give a special case, which came up on a recent question of mine (see the linked one above), and is in some way related to representation theory, where similar constructions are used.
Let $R$ be a ring with unity, then $R$ could be regarded as $R$-module by its regular action on itself, and the $R$-submodules are precisely the ideals then. Now suppose (considered as a module) we have $R = I \oplus J$ for two $R$-submodules. In the module we have $R / I \cong J$ as modules, i.e. we have a module isomorphism. Now if we look at $R$ as a ring again, then $I$ and $J$ are ideals, and so we can built the quotient ring $R / I$. Now I want to look at the relation of this quotient ring to $J$ (or $R / I$ as a module), and want to know if they are isomorphis as rings. In this special case if we write $1 = 1_I + 1_J$, then $1_J$ is an identity in $J$, as for $x \in J$ we have $x = x1 = x(1_I + 1_J) = x1_I + x1_J$ and $x1_I \in I$ and $x1_I \in J$ by the ideal properties, hence $x = x1_J$. So $J$ has a unity and is a ring. The map $\pi : R \to J$ gives a surjective homomorphism (it is like a projection) and its kernel is precisely $I$, hence $R / I \cong J$. But this situation is very special.
But in general, when are ideals also rings with unity, and what is their relation to the original ring?
Proposition: An ideal $I\lhd R$ will be a ring with identity iff there exists a central idempotent $e$ such that $eR=I$.
Proof:
($\implies$) The identity of $I$, call it $e$, is an idempotent element of $R$ and satisfies $I=eI$. Then $I=eI\subseteq eR\subseteq I$, so $I=eR$.
Since $e\in I$, we have $(1-e)Re\subseteq I=eR$. But $(1-e)Re\subseteq (1-e)R$ too, so $(1-e)Re\subseteq (1-e)R\cap eR=\{0\}$.
On the other hand, $e$ acting as a right identity on $I$ is equivalent to the condition that $I(1-e)=\{0\}$. Or in other symbols $eR(1-e)=\{0\}$.
These last two conditions imply that $e$ is central: $er-re=ere-re=-(1-e)re=0$.
You have the isomorphism of rings $R\cong eRe\oplus (1-e)R(1-e)$ given by the obvious mapping. (Things are simplified a bit since the $e$'s on the right can commute so that $ere=er$ and $(1-e)r(1-e)=(1-e)r$.) Replacing $eRe=eR=I$, you can see $\frac{R}{(1-e)R(1-e)}\cong I$ as rings.
For any idempotent $e\in R$, the set $eRe$ forms a ring called the "corner ring of $e$." A corner ring gets its name from the following isomorphism:
$$ R\cong \begin{bmatrix}eRe&eR(1-e)\\ (1-e)Re&(1-e)R(1-e)\end{bmatrix} $$
$(1-e)$ is also an idempotent, and $(1-e)R(1-e)$ is its corner ring.
When the off-diagonal entries are zero, you can see how the ring splits into two pieces as described above. The pieces can behave independently, though. If $eR$ is an ideal, then the $2,1$ position is zero, but the $1,2$ position need not be zero. In our case, it turns out that $eR$ having a right identity implies that the $1,2$ position is also zero. But in principal, that position could be nonzero.