This question depends on what we are allowed to assume; some
people take the given property as the definition of projective module.
Also the question does not require that R be commutative. Let us
use the definition that an R module P is projective if and only if
it is a direct summand of a free R-module. Suppose first that we
have the given property. Choose an epimorphism
f : F - > M
where F is a free R-module. Since the map f* : Hom(M, F) - > Hom(M, M) is surjective, there exists an R-module map
g : M - > F such that fg is the identity map on M. Then g is a
monomorphism and so
M
gM. Also
F = kerf
gM, which
shows that gM and hence also M are projective.
Conversely suppose M is a direct summand of a free module F.
First we show that F satisfies the given condition. Let
f : N - > N' be a surjection of R-modules and let
h : F - > N' be
any R-map. Let
{ei | i
I} be an R-basis for F,
where I is some indexing set. Since h is surjective, we may
choose ni
N such that
f (ni) = h(ei) for all i. Now we
can define g
HomR(F, N) by
g(ei) = ni for all i, and then
fg(ei) = h(ei) for all i. Thus fg = h, and we have proved
the result in the case M = F.
For the general case, write
F = M
P as R-modules, and let
y: M - > F be the natural monomorphism
Then we have a commutative diagram
| HomR(F, N) |
f* - > |
HomR(F, N') |
| y
*  |
|
y* |
| HomR(M, N) |
f* - > |
HomR(M, N') |
where (y
*g)(m) = g(ym) for all m
M and g
HomR(F, N) or HomR(F, N'). Note that
the right hand (and also the left hand) y* is surjective:
if h
HomR(M, N), we may extend h
to an R-map F - > N by defining it to be 0 on P and then y*h = g. By the previous paragraph the top f* is surjective and we
deduce that the bottom f* is surjective as required.