Let $\mathbb Z\_n$ denote the integers modulo $n$. Let $\mathbb Z\_n[i, j, k]$ be the quaternionic ring over $\mathbb Z\_n$, that is, the free module over $\mathbb Z\_n$ with basis $\{1, i, j, k\}$ and multiplication defined by 
$$i^2=j^2=k^2=ijk=-1.$$


It is well-known that if $n=p$ where $p$ is a odd prime then $\mathbb Z\_p[i, j, k]$ is isomorphic to the full matrix ring of order $2$ over $\mathbb Z\_p$. What can be said about the structure of $\mathbb Z\_n[i, j, k]$ for a composite $n$. Is also a full matrix ring? 


Note:If we can prove that $\mathbb Z\_n[i, j, k]$ is semi-simple then it is necessarily a direct sum of matrix rings over a field by a theorem of Wedderburn. 



Quaternion ring
Yes, for odd $n$, the ring $(\mathbb Z/n)[i,j,k]$ is isomorphic to the ring of two-by-two matrices over $\mathbb Z/n$.


To explain this, it is better to write $\mathbb Z/n$ and $\mathbb Z/p$ rather than $\mathbb Z\_n$ and $\mathbb Z\_p$, because, in fact, the decisive statement concerns $p$-adic integers $\mathbb Z\_p$, and we should reserve the notation for that.


What is true is that, using the notation for $p$-adic integers, for odd prime $p$, $\mathbb Z\_p[i,j,k]$ is the full matrix ring over the $p$-adic integers $\mathbb Z\_p$. Granting this for a moment, $(\mathbb Z/p^\ell)[i,j,k]$ is the image of $\mathbb Z\_p[i,j,k]$ by mapping $p^\ell \mathbb Z\_p$ to $0$, since $\mathbb Z\_p/p^\ell \mathbb Z\_p\approx \mathbb Z/p^\ell \mathbb Z$. 


By Sun-Ze's theorem, the general $\mathbb Z/n$ is the sum of the $\mathbb Z/p^\ell$ where $p^\ell$ are the prime powers dividing $n$. Thus, for odd $n$, $(\mathbb Z/n)[i,j,k]$ is the sum of the corresponding rings for the $p^\ell$.


To prove that $\mathbb Z\_p[i,j,k]$ is the full matrix ring, start with the point that $\mathbb Q\_p[i,j,k]$ is the full matrix ring, for odd $p$. There are various proofs of this... For example, the surjectivity of norms on finite fields, together with Hensel's Lemma, proves that the quadratic form $a^2+b^2+c^2+d^2=\hbox{norm}(a+bi+cj+dk)$ has a non-trivial zero, so $\mathbb Q\_p[i,j,k]$ is not a division ring.


The additional ingredient is that the ring of "Hurwitz integers" consisting of $\mathbb Z[i,j,k]$ with $(1+i+j+k)/2$ adjoined is Euclidean, in the appropriate sense for a non-commutative ring. "Locally" at odd primes $p$, the $1/2$ in the definition of the Hurwitz integers is a unit, so, locally, at odd primes, the $p$-adic version of the Hurwitz integers is the naive notion of local quaternion integers, $\mathbb Z\_p[i,j,k]$. The rest of the discussion is just clean-up.


