Let’s fix a ring R. A module (assumed to be a left module, I suppose, but it doesn’t really matter as long as we’re consistent) M is said to be projective if the functor Hom(M,-) is exact. (That is, if 0\to A\to B\to C\to 0 is a short exact sequence of R-modules, then 0\to Hom(M,A)\to Hom(M,B)\to Hom(M,C)\to 0 is also exact.) Dually, M is said to be injective if the functor Hom(-,M) is exact.

There are various equivalent conditions for projectives and injectives. One particularly useful result is that projective modules are exactly the direct summands of free modules. Another one is that injective modules satisfy a certain extension property: A module J is injective if and only if for any map \phi:A\to J and any injective map f:A\to B, there exists a map (not necessarily unique) \theta:B\to J so that \phi=\theta\circ f.

Actually, we didn’t need to start with a ring R at all; it would make just as much sense to allow M to be an object in an arbitrary abelian category \mathcal{C}. We say that \mathcal{C} has enough projectives if for every object A of \mathcal{C}, there is an epimorphism (or, a surjective map, in the case of many interesting categories) P\to A, where P is projective. Dually, \mathcal{C} has enough injectives if for every object A of \mathcal{C}, there is a monomorphism (or, an injective map, in the case of many interesting categories) A\to J, where J is injective.

It is easy to see that the category of modules over a ring R has enough projectives: if A is an R-module, just take the free module on all the elements of A, and then quotient out by the submodule consisting of all relations in A. Hence A is isomorphic to a quotient of a free (and hence projective) module.

It is also true that the category of modules over a ring R has enough injectives, but this is a bit trickier to prove. To begin, we note that an arbitrary product of injective objects is injective. This follows from the isomorphism Hom(A,\prod_{i\in I} B_i)\cong\prod_{i\in I} Hom(A,B_i). We also note (although I’m not going to prove it here) that in the category of abelian groups (or \mathbb{Z}-modules), injective modules are the same as divisible modules (i.e. modules M so that the maps m\mapsto nm for n\neq 0 are all surjective).

Let’s first show that the category of abelian groups has enough injectives. The abelian group that plays the most important role here is \mathbb{Q}/\mathbb{Z}. Let A be any abelian group, and let I(A) be the product of copies of \mathbb{Q}/\mathbb{Z}, indexed by the set Hom(A,\mathbb{Q}/\mathbb{Z}). Then I(A) is injective, and there is a canonical map e_A:A\to I(A). We now check that e_A is actually an injective map. To do this, pick 0\neq a\in A. It is easy to find some nontrivial map a\mathbb{Z}\to\mathbb{Q}/\mathbb{Z}. By the extension property for injective modules, this map extends to a map on all of A. This is enough to show that e_A is an injective map.

Now let’s return to the category of modules over an arbitrary ring R. It can be shown that if J is an injective abelian group, then Hom(R,J) has the structure of an injective R-module. Now, let M be an arbitrary R-module. Then let I(M) be the product of copies of I_0=Hom(R,\mathbb{Q}/\mathbb{Z}), indexed by the set Hom_R(M,I_0). Then, just as before, there is a canonical injective map M\to I(M). This completes the proof that the category of R-modules has enough injectives.