How do I show that this function is well defined?
Solution 1:
To show a function is well defined, you need to show that every input has a unique output. For example, you might try to define a function from $\{1,2,3\}$ to $\{1,2\}$ by the two functions $f_1:\{1,2\}\rightarrow \{1,2\}$ and $f_2:\{2,3\}\rightarrow \{1,2\}$ where $$f_1(1) = 1$$ $$f_1(2) = 2$$ $$f_2(2) = 1$$ $$f_2(3) = 2$$
Notice how $f_1(2) \neq f_2(2)$. So the "function" $f$ you defined wouldn't actually be a function since it doesn't know how to assign a unique value to $2$.