I would appreciate it if someone could go over my proof. Thank you
Problem
Suppose $f: A \rightarrow C$ and $g: B \rightarrow C$.
a)Prove that if A and B are disjoint, then $f \cup g: A \cup B \rightarrow C$.
b)More generally, prove that $f \cup g: A \cup B \rightarrow C$ iff $f|(A \cap B) = g|(A \cap B)$
The book defines $f|C$ as follows
Suppose $f: A \rightarrow B$ and $C \subseteq A$. Then $f|C = f \cap (C \times B)$
proof for a):
I will show that for all $x \in A \cup B$, there is a unique $c \in C$ such that $(x,c) \in f \cup g$.
Existence
Let x be arbitrary and suppose $x \in A \cup B$. If $x \in A$, there exists $c \in C$ such that $(x,c) \in f$ Similarly, if $x \in B$, there is $c \in C$ such that $(x,c) \in g$. Therefore, there is at least one $c \in C$ such that $(x,c) \in f \cup g$.
Uniqueness
Suppose $(x, c_1) \in f \cup g$. If $x \in A$, then $(x, c_1) \in f$ and $c_1$ is unique by definition. If $x \in B$, then $(x, c_1) \in g$ and $c_1$ is unique by the definition of function. Since A and B are disjoint, I do not need to cover the case when $x \in A \cap B$.
Therefore, there is a unique $c \in C$ for every $x \ in A \cup B$. Hence, $f \cup g$ is a function from $A \cup B$ to C.
proof for b)
proof for $f|(A \cap B) = g|(A \cap B) \rightarrow f \cup g: A \cup B \rightarrow C$
Assume $x \in A$ and $x \notin B$. Then, there is a unique $c \in C$ such that $(x,c) \in f$, which means $(x,c) \in f \cup g$.
Similarly, assume $x \in B$ and $x \notin A$. Then there is a unique $c \in C$ such that $(x,c) \in g$, hence $(x,c) \in f \cup g$
Now assume $x \in A \cap B$. By assumption, for all $x \in A \cap B$, there is a unique $c_1$ such that $(x, c_1) \in f|(A \cap B)$ and $(x, c_1) \in g|(A \cap B)$.
Hence, we know that for all $x \in A \cap B$, there is $c \in C$ such that $(x,c) \in f \cup g$.
Assume $(x,c_1) \in f \cup g$ and $(x,c_2) \in f \cup g$. Since $x \in A \cup B$, $c_1 = c_2$ since $(x, c_1) \in f|(A \cap B) = g|(A \cap B)$.
Therefore, for all $x \in A \cup B$, there is a unique $c \in C$ such that $(x,c) \in f \cup g$.
proof for $ f \cup g: A \cup B \rightarrow C \rightarrow f|(A \cap B) = g|(A \cap B)$
By assumption, for all $x \in A \cup B$, there is a unique $c_1 \in C$ such that $(x,c_1) \in f \cup g$. This means $(x, c_1) \in f$ or $(x, c_1) \in g$. If $x \in A$, then $(x, c_1) \in f$. If $x \in B$, then $(x, c_1) \in g$. But since x is element of both A and B, $(x, c_1) \in f$ and $(x, c_1) \in g$.
By above, $f|(A \cap B)(x) = g|(A \cap B)(x) = c_1$. Hence, $f|(A \cap B) = g|(A \cap B)$