Functions, by their definition are well-defined: if one has a relation $f \in A \times B$, it is a function if and only if whenever $(a,b),(a,b') \in f$ we have $b = b'$. This allows to write (unambiguously) $b = f(a)$.
So functions can be:
1) One-to-one (these functions are called injective).
2) Many-to-one (for example, constant functions from a domain with more than one element).
Functions cannot be:
3) One-to-many. An image of a domain element must be a singleton.
However, with group homomorphsims, we often have homomorphisms defined on quotient groups (which are certain equivalence classes of a group).
Here is an example of something which is not well-defined: suppose we try to define-
$f: \Bbb Z_6 \to \Bbb Z$ by:
$f([a]_6) = a$. (Here, $[a]_6$ is the equivalence class of $a$ modulo $6$, where the equivalence is defined by:
$a\sim b \iff a-b$ is a multiple of $6$).
Note that $_6 = _6$, since $9-3 = 6$. But $f(_6) = 3 \neq 9 = f(_6)$.
We no longer have a unique image for $[a]_6$, it is not well-defined.
So when we define a function on a set of equivalence classes using elements contained in those equivalence classes, we need to be sure our choice of image is independent of the particular "representative" (element of the equivalence class) we calculate the image from. Another way of saying this, is that $f$ needs to be constant on each equivalence class, to induce a function on the equivalence classes.
Perhaps you have "well-defined" confused with injective, they look similar:
$f$ is injective if $f(a) = f(a') \implies a = a'$
Homomorphisms, unlike isomorphisms, are not required to be injective, isomorphisms must be (they must be surjective, or onto, as well). In fact, much of what is interesting about group theory comes from the fact that often, group homomorphisms are not injective, which leads to questions on "how much of the original group structure is preserved".