$M^{2\times 2}(\mathbb{Z})$ has identity $e_1$, but a certain subring $R$ has another identity $e_2$ and $e_1 \notin R$. I'm a bit confused. Consider the following situation:

We know $M^{2\times 2}(\mathbb{Z})$ has an identity for $\cdot$ which is $$e_1 =\begin{pmatrix} 
1 & 0 \\
0 & 1 \\
\end{pmatrix}.$$
Now consider the subring $$A = \left\{\begin{pmatrix} 
x & 0 \\
0 & 0 \\
\end{pmatrix}\mid x \in \mathbb{Z}\right\},$$
which has identity element:$$e_2 =\begin{pmatrix} 
1 & 0 \\
0 & 0 \\
\end{pmatrix}.$$

In my book on algebra, it says that if $1\in R$ and $S\subset R$ is a subring of $R$, then $1\in S$ needs to be met. But in this example, this is not the case. Can someone help with my confusion?

The definition of "ring" varies in whether it includes 1 (and even commutativity of multiplication). Generally, those who hold 1 isn't required for a ring will not require a subring to have the same 1. It's a matter of differing conventions.
On the other hand, if this occurs in the same book that says subrings must include the same 1, that's an issue.
