Note: I will be using $\uplus$ to represent disjoint unions. $f$ and $g$ are not explicitly defined in the question I have and are meant to be abstract.
I have some 2 surjections $C : A \mapsto B$ and $D : X \mapsto Y$, and I want to show that:
a) $f : A\times X \mapsto B \times Y$ is a surjective function too, and
b) $g : A \uplus X \mapsto B \uplus Y$ is also surjective.
I know it's kind of obvious that since A and B are domains of surjective functions, we can definitely map all values in the domains to a corresponding value in its co-domain. Formally, we want to show that $\forall a \in A$, there exists some $b \in B$ such that $f(a) = b$. Since function $C$ can at least map to one element in $B$, and so could D for mapping X to Y, part (a) seems obvious.
But is there a way to prove this formally? I have meddled with some set builder notation but it looks unclean and all it seems is that I'm writing unnecessary notations.
Also for proving the disjoint union function is surjective, I have tried letting $\forall (k, n), n \in \{0, 1\}, k\in A \lor k \in X$, we have some $l \in B \lor l \in Y$ such that $g(k,n) = (l, n)$.
But this doesn't seem to be the right way to prove it.
Let's start with the first problem -- saying what $f$ and $g$ are:
I believe you mean to write $$ f: A \times X \to B \times Y : (a, x) \mapsto (C(a), D(x)) $$ and for the second, I think you mean that $$ g: A \cup X \to B \cup Y : u \mapsto \begin{cases} C(u) & u \in A\\ D(u) & u \in X \end{cases}. $$ Do I have that about right? If not, please correct me. But without some definition of $f$ and $g$, the whole problem is meaningless.
Assuming so, let's proceed to the second problem, which is considerably easier once that first (unwritten) one is out of the way.
To show that $f$ is surjective, take an arbitrary element $(b, y)$ of the codomain, where $b \in B$ and $y \in Y$. Because $f$ is surjective, there's some element $q \in A$ with $C(q) = b$; similarly, there's an element $r \in X$ with $D(r) = y$ (again by surjectivity).
Now look at $f(q, r)$. By definition (which you have to write down or the whole problem is meaningless!), we have
$$ f(q, r) = (C(q), D(r)) = (b, y). $$ Hence the point $(b, y)$ is in the image of $f$.
Now: you try it for the disjoint union case. Your proof will have two cases, depending on whether the target item $s$ is in $B$ or is in $Y$. It cannot be in both, because the codomain is a disjoint union (even though I haven't used the special symbol for that).