Unions and Functions on Sets

I suppose the best way to do this is to show the two inclusions (namely $f(X\cup Y)\subseteq f(X)\cup f(Y)$ and $f(X)\cup f(Y)\subseteq f(X\cup Y)$), and to use definitions. For the first inclusion, this gives :

Let $x\in f(X\cup Y)$. This means that there exists a $y\in X\cup Y$ such that $f(y)=x$. Now $y\in X\cup Y$ means that either $y\in X$ or $y\in Y$. Now if $y\in X$, then $x\in f(X)$, and if $y\in Y$, then $x\in f(Y)$. In any instance, $x\in f(X)\cup f(Y)$. We proved that any $x$ in $f(X\cup Y)$ is also in $f(X)\cup f(Y)$, that is precisely $f(X\cup Y)\subseteq f(X)\cup f(Y)$. The other inclusions proceeds similarly.


To get started, write out the definitions of $f(X\cup Y)$, $f(X)$, and $f(Y)$: $$f(X\cup Y)=\{b\in B\mid \text{there exists an }a\in X\cup Y\text{ such that }b=f(a)\}$$ $$f(X)=\{b\in B\mid \text{there exists an }a\in X\text{ such that }b=f(a)\}$$ $$f(Y)=\{b\in B\mid \text{there exists an }a\in Y\text{ such that }b=f(a)\}$$ Also, remember that for two sets $C$ and $D$, $$z\in C\cup D\iff z\in C\;\text{ or }\,z\in D.$$ Do you see how to go the rest of the way?