What is the injective envelope of $\mathbb{Z}/n\mathbb{Z}$? 
In the category of $\mathbb{Z}$-modules, what is the injective envelope of $\mathbb{Z}/n\mathbb{Z}$?

I was hoping to find a divisible group containing $\mathbb{Z}/n\mathbb{Z}$ such that it is also an essential extension. We already know that $\mathbb{Z}/n\mathbb{Z} \rightarrowtail \prod_{i \in \lbrace 1,\ldots,n \rbrace}(\mathbb{Q}/\mathbb{Z})_i  $. But is this an essential extension? I can't prove or disprove it.
Guessing by the 'size' of it ($\prod_{i \in \lbrace 1,\ldots,n \rbrace}(\mathbb{Q}/\mathbb{Z})_i   $), i don't think that it is the right answer.
Also, is there an algorithm sort of thing for finding injective envelope for modules over arbitrary rings.
 A: The injective envelope is $\mathbb{Z}[\frac{1}{n}]/\mathbb{Z}$
We define $$[k]\mapsto \frac{k}{n} +\mathbb{Z}$$ 
we must show that this is an essential extension and that $\mathbb{Z}[\frac{1}{n}]/\mathbb{Z}$ is injective (for groups =divisible)
First a typical element of $\mathbb{Z}[\frac{1}{n}]/\mathbb{Z}$ is $\frac{a}{n^l}+\mathbb{Z}$ with $n\not | a$. And multiplying by  $n^{l-1}$ we get $\frac{a}{n}+\mathbb{Z}$ and this is an element of the image of $\mathbb{Z}_n$ (and is $\neq 0$ since $n\not | a$).
To show that  $\mathbb{Z}[\frac{1}{n}]/\mathbb{Z}$ is divisible take first the case where $p$ is a prime not dividing $n$ then to divide $\frac{1}{n^l}+\mathbb{Z}$ by $p$ there are $a$ and $b$ such $pa+bn^l=1$ then
$$p\frac{a}{n^l}+\mathbb{Z}=\frac{1}{n^l}-\frac{bn^l}{n^l}+\mathbb{Z}=
\frac{1}{n^l}+\mathbb{Z}$$ 
On the other hand if $p|n$ then let $n=mp$
$$p\frac{m}{n^{l+1}}+\mathbb{Z}= \frac{1}{n^l}+\mathbb{Z}$$ 
This shows that  $\mathbb{Z}[\frac{1}{n}]/\mathbb{Z}$ is an essential, divisible extension of $\mathbb{Z}_n$. 
A: If $n=p_1^{a_1}p_2^{a_2}\dots p_k^{a_k}$ is the decomposition of $n$ into (distinct) prime powers, we know that
$$\def\Z{\mathbb{Z}}
\frac{\Z}{n\Z}=\bigoplus_{i=1}^k \frac{\Z}{p_i^{a_i}\Z},
$$
so we just need to find the injective envelope of $\Z/p^a\Z$, for a prime $p$. This is well known to be the Prüfer $p$-group $\Z(p^\infty)$. Thus the answer is
$$
\bigoplus_{i=1}^k \Z(p_i^\infty).
$$
This is a particular case of the following. If $M$ is an artinian $R$-module, we can write the socle of $M$ (the sum of all simple submodules of $M$) as
$$
\bigoplus_{i=1}^k S_i
$$
for a suitable set $\{S_1,S_2,\dots,S_k\}$ of simple submodules of $M$. Then the injective envelope of $M$ is $\bigoplus_{i=1}^k E(S_i)$, where $E(S)$ is the injective envelope of $S$. There is no general method for computing the injective envelope of an arbitrary module over an arbitrary ring.
