Solution.
Since ab=A, there exist a1,…,an∈a and b1,…,bn∈b such that ∑i=1naibi=1. For each i, define f:a→A via a↦abi so that
a=i=1∑naaibi=i=1∑naifi(a).
fi is well-defined as ab=A, and note that this implies a1,…,an generate a.
Now consider An with basis {e1,…,en}, and define π:An→a via ei↦ai. Since the ai generate a, this is a surjection. On the other hand, consider the map σ:a→An, a↦∑i=1nfi(a)ei. We have
(π∘σ)(a)=π(i=1∑neifi(a))=i=1∑naifi(a)=a,
i.e., π∘σ=ida, so the sequence
0→kerπ→An→a→0
splits. Thus, a⊕kerπ≃An, so a is a direct summand of a free module, hence projective.