I have encountered the following definition of a subgroup $H$ of a group $G$: A subset $H$ of a group $G$ is a subgroup of $G$ provided the inclusion $i_H :H \longrightarrow G$ is a homomorphism. I am trying to show that this characterization is equivalent to the "usual" definition that declares a subset of a group is a subgroup if it is itself a group.
So, suppose the inclusion is a homomorphism. The first thing I want to show is that $H$ is stable under the group operation. This seems pretty straightforward: If $x,y \in H$ we have $ i_H(x)i_H(y) = i_H(xy) = xy \in \text{Im}(i_H) \implies xy \in H $
The first equality follows from the hypothesis that $i_H$ is a homomorphism and the second follows from the definition of the inclusion map and, finally, the last conclusion follows from the fact that $\text{Im}(i_H) = H$. So far so good, I believe.
I'm stuck though when trying to show that $H$ contains the identity element. Now, any homomorphism $\varphi$ from a group $E$ to another group $F$ will carry the group identity $e_E \in E$ to the group identity $e_F \in F$, i.e., $\phi(e_E) = e_F$. Would I be correct in saying that since $i_H$ is a homomorphism then $e_G$ must me in the image of $i_H$ and therefore must be in $H$?
This doesn't seem quite right to me because this more-or-less assumes that $e_G$ is in the domain of $i_H$ to begin with. But, this raises a second question in that what, precisely, does it mean for any function to be a homomorphism between a subset and a group?