I don't know if I am asking a silly question, but what is the exact definition of a graph homomorphism (throughout, the graphs may be assumed to be simple, i.e. undirected, no loops, no multiple edges, etc)? I have a slight confusion with the existing definition, which says that a function f : V(G) to V(H) is called a graph homomorphism, if whenever (i,j) is an edge of G, (f(i),f(j)) is an edge of H. The confusion is that, suppose that f(i) = f(j), and suppose that (i,j) is an edge of G. Then, is f still a homomorphism? Or does a graph homomorphism necessarily have to be an injective function (in set-theoretic sense)? Please help me settle this issue, as it would be very embarassing to have his kind of a misconception at the beginning of my study of graph theory!
Graph homomorphisms need not be injective on vertices. For example, arbitrary functions from a graph with no edges to another graph are always homomorphisms. What you've noticed is that two vertices sharing an edge cannot be identified if there are no loops, because an edge must be present in the image by definition.