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!