Definition of generator in an abelian category. 
Let $\mathcal A$ be an abelian category. Let an object $G$ in $\mathcal A$ be such that $Hom\left(G,\unicode{x2013} \right)$ is a faithful functor from $\mathcal A$ to the category of sets.(I assume that I am working with a category where any family of objects has their coproduct existing inside the category)

Why is the above equivalent to the fact that every object $X$ in $\mathcal A$ admits an epimorphism $G^I$ to $X$? (where $I$ is the index category and is arbitrary)(where,$G^I$  is coproduct of copies of $G$ which exists in that category)
I do not see how injectivity of maps getting translated to epimorphism and vice versa? I guess I should start with appropriate short exact sequence and apply appropriate functor to make injectivity translated to epimorphism but I have no clue how to proceed practically, i.e how to make it precise.
Any help from anyone is welcome.
 A: Suppose there is an epimorphism $p:G^I\to X$ and suppose $f:X\to Y$ is a morphism which becomes $0$ after applying the functor $\operatorname{Hom}(G,-)$.  This means that for every morphism $g:G\to X$, $fg=0$.  In particular, by taking $g$ to be each of the inclusion maps $G\to G^I$ composed with $p$, this implies $fp=0$.  Since $p$ is an epimorphism, this implies $f=0$.  Thus if such an epimorphism $p$ exists for every $X$, $\operatorname{Hom}(G,-)$ is faithful.
Conversely, suppose $\operatorname{Hom}(G,-)$ is faithful and let $X$ be an object.  Let $I=\operatorname{Hom}(G,X)$ and let $p:G^I\to X$ be the unique morphism such that for each $i\in I$, the composition of $p$ with the $i$th inclusion map $G\to G^I$ is $i:G\to X$.  I claim $p$ is an epimorphism.  To show this, it suffices to show that if $f:X\to Y$ is a morphism such that $fp=0$, then $f=0$.  But given any such $f$, by composing with the inclusion maps $G\to G^I$ we see that $fi=0$ for all $i:G\to X$.  This means that $\operatorname{Hom}(G,-)$ sends $f$ to $0$ and thus $f=0$ since $\operatorname{Hom}(G,-)$ is faithful.
