Let $R$ be a ring with unity $1_R$. Suppose $S$ is a subring but it does not contain $1_R$. But still it may contain a subring unity $1_S$. For example $R=M_2(\mathbb R)$ and $S$ be the set of all matrices with first entry in $\mathbb R$ and the rest three $0$. Then the element with first entry $1$ and rest three zero is identity of $S$. Why is this happening?It seems a bit weird to me. We can also take the example of $\mathbb Z_6$ and its subring $\{0,3\}$.
I have searched for the answer to this question in stack exchange but the answers, although they have no problem, is out of my scope of understanding as I am a beginner of Ring theory.
First, one must be careful in how one defines rings.
From the point of view of universal algebra, there are two related structures: rings, and rings with unity.
Rings have four operations: a binary operation $+$, a binary operation $\cdot$, a unary operation $-$ (additive inverse), and a nullary operation $0$ (additive neutral element), and satisfies a bunch of identities (which make $(R,+,-,0)$ into an abelian group, $(R,\cdot)$ into a semigroup, and where $\cdot$ distributes over $+$ on both sides). Substructures are required to be closed under the operations, and morphisms are required to respect the operations.
Rings with unity have five operations: in addition to the four operations and identities mentioned above, there is a second nullary operation, $1$, which makes $(R,\cdot,1)$ into a monoid. Substructures are required to respect all operations, so subrings-of-rings-with-unity are required to have the same unity as the original ring (just like a submonoid is required to have the same identity as the original monoid). And morphisms are required to respect all operations, so that morphisms are required to be unital (send $1$ to $1$). For example, this is the convention in Lam’s First Course in Noncommutative Rings.
If you do not require rings to have an identity, then the existence of one is more happenstance than structure; this is much like the way in which a subgroup of a group may happen to be abelian, even if you do not require your groups to be abelian; or how a semigroup may happen to have an identity, even though you do not require things to be monoids.
When that happens, the situation you are seeing is the situation that occurs with semigroups and monoids. A semigroup may happen to be a monoid (have a multiplicative identity), but not every subsemigroup will necessarily have an identity, or even if it does it need not be the same as the identity of the original semigroup.
It may seem weird because we are used to groups, not semigroups. But this kind of behavior happens in semigroups all the time. In fact, given any semigroup $S$, one may extend it to a larger semigroup by adding an element $1$ that acts as an identity, even if $S$ already had one! So you can have an infinite increasing sequence of semigroups $S_0\subseteq S_1\subseteq S_2\subseteq\cdots$ where $S_i$ is a proper subsemigroup of $S_{i+1}$, and $S_i$ has an identity for each $i\gt 0$, and the identity of $S_i$ is different from the identity in $S_{i+1}$. And because rings are only required to be semigroups under multiplication, this tells you that there is no reason why this kind of behavior will not occur in rings as well (and in fact, it does... given any ring $R$, there is a construction, called the Dorroh extension, that embeds $R$ into a ring with identity that is strictly larger than $R$, and where $R$ is a proper ideal of the new ring; even if $R$ already had an identity).
So, yeah, it’s weird when one is used to groups, but it shouldn’t be. Or at least, it will seem less weird with some experience.