Using the first Isomorphism theorem to prove that $S$ is a subring of $M_2(\mathbb{Z})$ Consider the map $\phi : O \rightarrow S $ s.t $a+bw \mapsto  \begin{bmatrix} a & b\\ \dfrac{D-1}{4}b & a+b\end{bmatrix}$
Where $O$ is the quadratic integer ring and $S$ the set $\{\begin{bmatrix} a & b\\ \dfrac{D-1}{4}b & a+b\end{bmatrix}, a,b \in \mathbb{Z} \}$.
Now I showed that $\phi$ is homomorphic.
I want to show that $S$ is a subring of $M_2(\mathbb{Z})$
Since $\phi$ is homomorphic, I know that $Im(\phi)$ (which is equal to $S$) is isomorphic to $S$.
I guess I could simply create the homomorphism $\delta : O \rightarrow M_2(\mathbb{Z}) $ which maps $a+bw$ onto  $\begin{bmatrix} a & b\\ \dfrac{D-1}{4}b & a+b\end{bmatrix}$
and similarly, show that $\delta$ is homomorphic and that it's image is S and therefore, by the first isomorphism theorem that $S$ is a subring of $M_2(\mathbb{Z})$.
Is that the right way to go about?
 A: I assume that $\mathcal{O}$ is the ring of integers in $\mathbb Q(\sqrt D)$ with $D\equiv 1 \bmod 4$, and so $\mathcal{O} = \mathbb Z \, 1 + \mathbb Zw$ with $w=\dfrac{1+\sqrt D}{2}$.
Here is how this isomorphism comes up.
Let $\alpha = a + bw \in \mathcal{O}$ and consider the map $\mu: x \mapsto x\alpha$.
With respect to the $\mathbb Z$-basis of $\mathcal{O}$ given by $(1,w)$, the map $\mu$ is represented by the matrix
$$
A=\begin{bmatrix} a & b\\ \dfrac{D-1}{4}b & a+b\end{bmatrix}
$$
in the sense that
$$
\mu(1) = \begin{bmatrix} 1 & 0\end{bmatrix} A
\\
\mu(w) = \begin{bmatrix} 0 & 1\end{bmatrix} A
$$
In other words, if $x = u + v w \in \mathcal{O}$, then 
$$
\mu(x) = \begin{bmatrix} u & v\end{bmatrix} A
$$
These maps $\mu$ induce a homomorphism $\phi:\mathcal{O} \to  M_2(\mathbb{Z})$ given by $\alpha \mapsto A$.
Since $x(\alpha\beta)=(x\alpha)\beta$, we have the matrix identity $[x](AB)=([x]A)B$ and so $\phi(\alpha\beta)=\phi(\alpha)\phi(\beta)$.
It is easy to prove that $\phi$ is injective and that its image is $S$. This implies that $\mathcal{O} \cong \operatorname{im}(\phi) = S$.
A: Well, you already know hat $S$ is a subset of $M_2(\mathbb{Z})$, because the matrix has entries in the integers, now we need to show that $S$ is closed under multiplication and addition. 
Addition is easy as:
$$\begin{pmatrix}
a_1 & b_1 \\ 
\frac{D-1}{4} b_1 & a_1+b_1
\end{pmatrix} +\begin{pmatrix}
a_2 & b_2 \\ 
\frac{D-1}{4} b_2 & a_2+b_2
\end{pmatrix} = \begin{pmatrix} a_3 &  b_3 \\ \frac{D-1}{4}b_4 & a_3+b_3  \end{pmatrix}  \in S $$
Where $a_3 =a_1 + a_2$, $b_3 = b_1 + b_2$. Multiplication is the same procedure (multiply two matrices and check that the entries satisfy the conditions for $S$), and the identity and 0 matrices are both in $S$, so it is a subring of $M_2(\mathbb{Z})$. No need for any fancy isomorphism theorems or anything, just simply bookkeeping of definitions. 
