Retract of projective object is projective An object $P$ in a category $\mathcal{C}$ is called projective if the functor $\mathcal{C}(P,-): \mathcal{C} \rightarrow Set$ preserves epimorphisms.
Now I have to prove the following:
Every retract of a projective object is again projective.
So let $r: P \rightarrow A$ be a retraction in $\mathcal{C}$ and $f: X \rightarrow Y$ an epimorphism in $\mathcal{C}$.
Let $s: A \rightarrow P$ be the morphism in $\mathcal{C}$ with $r \circ s = 1_{A}$.
 Now I have to prove that $\mathcal{C}(A,f): \mathcal{C}(A,X) \rightarrow \mathcal{C}(A,Y)$ is an epimorphism.
I've tried to prove it using the definition of an epimorphism:
$$\phi \circ C(A,f) = \psi \circ C(A,f) \Rightarrow \phi = \psi$$
but I didn't get anything nice. Just a bunch of equalities from where I couldn't conclude '$\phi = \psi$'
Can someone give me a hint how I can relate this to the morphism $\mathcal{C}(P,f)$ (which is an epimorphism) or the retraction $r$?
Or is there an easier way to handle this problem? For example, by using the fact that in Set an epimorphism is a surjective function?
As always, any help would be appreciated!
 A: See also Proposition 4.6.4 in Borceux F. Handbook of categorical algebra. Vol. 1. Basic category theory (CUP, 1994). Although the definition of projective object is slightly different (the definition in that book uses strong epimorphism instead of epimorphism), the proof almost identical.

$\newcommand{\Zobr}[3]{{#1}\colon{#2}\to{#3}}\newcommand{\ol}[1]{\overline{#1}}$The fact that $P$ is projective
means the following:
Whenever we have an epimorphism $\Zobr fXY$ and a morphism $\Zobr pPY$, then there exists a morphism $\Zobr{\ol p}PX$ such that $f\circ\ol p=p$.

Now we have the following situation: We have a retraction $\Zobr rPA$ a morphism $\Zobr pAY$ and an epimorphism $\Zobr fXY$.

The rest of solution is: draw the obvious arrows to complete the diagram.
This would be a logical place to stop, if you only want a hint and want to do the rest by yourself.
Since it is already some time since you posted your question, I guess posting full solution will not do much harm.
(And of course you can simply ignore the rest of you post.)
We have the morphism $q=p\circ r$. Since $P$ is projective, there is a morphism $\ol q$ such that $f\circ \ol q=q=p\circ r$. Thus we get
$$f\circ\ol q \circ s=p\circ r\circ s=p\circ 1_A=p,$$
i.e. we have shown that there is a morphism $\ol p = \ol q\circ s$ fulfilling $f\circ\ol p=p$.

I hope that the uploaded diagram will last some time, but I also uploaded the LaTeX source to pastebin.
