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?
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.