# Conjecture: a function is a group-homomorphism iff it's a subgroup of the direct product.

Conjecture. Let $G$ and $H$ denote groups, and let $f : G \rightarrow H$ denote a function. Then $f$ is a homomorphism precisely when the graph of $f$ is a subgroup of the direct product $G \times H$.

Motivation. It has been proven elsewhere that if we replace the instances of the word "groups" with the word "vector spaces", and if we replace "homomorphism" with "linear map," and "subgroup" with "linear subspace" then the conjecture is true. (However, that proof is not in English.)

Is this a well-known result? Can anyone think of a counterexample?

-
Do you really mean subset of the direct product of the groups ? The graph of any function $G\to H$ is such a set. – Klaus Feb 2 '13 at 12:41
Dear lord no! I fixed it. – goblin Feb 2 '13 at 12:41

Yes, this is well-known. If $f$ is a homomorphism, then the graph $G_f$ is a subgroup: from $(x,f(x)) \in G_f$ and $(y,f(y)) \in G_f$ we get $(xy,f(x)f(y))=(xy,f(xy))\in G_f$. Analogous reasoning can be done for inverse. Conversely, if $G_f$ is a subgroup, then $(x,f(x)) \in G_f$ and $(y,f(y)) \in G_f$ multiplied give $(xy,f(x)f(y))\in G_f$, which means $f(x)f(y)=f(xy)$.