How do you in general prove that a function is well-defined?

f:X→Y:x↦f(x)

I learned that I need to prove that every point has exactly one image. Does that mean that I need to prove the following two things:

- Every element in the domain maps to an element in the codomain:

x∈X⟹f(x)∈Y- The same element in the domain maps to the same element in the codomain:

x=y⟹f(x)=f(y)

At the moment I’m trying to prove this function is well-defined: f:(Z/12Z)∗→(Z/4Z)∗:[x]12↦[x]4, but I’m more interested in the general procedure.

**Answer**

When we write f:X→Y we say three things:

- f⊆X×Y.
- The domain of f is X.
- Whenever ⟨x,y1⟩,⟨x,y2⟩∈f then y1=y2. In this case whenever ⟨x,y⟩∈f we denote y by f(x).

So to say that something is well-defined is to say that all three things are true. If we know *some* of these we only need to verify the rest, for example if we know that f has the third property (so it is a function) we need to verify its domain is X and the range is a subset of Y. If we know those things we need to verify the third condition.

But, and that’s important, if we do not know that f satisfies the third condition we cannot write f(x) because that term assumes that there is a unique definition for that element of Y.

**Attribution***Source : Link , Question Author : Kasper , Answer Author : Asaf Karagila*