# Show that $f(A \cup B) \subseteq f(A) \cup f(B)$, $f(A) \setminus f(B) \subseteq f(A \setminus B)$ [duplicate]

Let $A, B$ be two subsets of a set $X$, and let $f : X \rightarrow Y$ be a function. Show that $f(A \cup B) \subseteq f(A) \cup f(B)$, $f(A) \setminus f(B) \subseteq f(A \setminus B)$. Is it true that the $\subseteq$ relation can be improved to $=$?

I proved $f(A \cup B) \subset f(A) \cup f(B)$ and $f(A) \setminus f(B) \subset f(A \setminus B)$. But i'm not sure when we improved the $\subseteq$ by $=$. Can anyone give me some examples when the relation is $=$?

## marked as duplicate by Community♦May 3 '17 at 14:57

• E.g. $f=\mathrm{Id}_X: X\to X$. – JJR May 1 '17 at 17:14
If $y \in f(A) \cup f(B)$, then $y = f(a)$, with $a \in A$ or $y = f(b)$, with $b \in B$.
In any case, $y = f(x)$, with $x \in A \cup B$, and so $y \in f(A \cup B)$.
In the case of $f(A) \setminus f(B) \subseteq f(A \setminus B)$, you have an equality if $f$ is injective:
If $y \in f(A \setminus B)$, then $y = f(x)$, with $x \in A \setminus B$, and so $y \in f(A)$.
If $y \in f(B)$, then there exists $x' \in B$ with $f(x') = y$.
But that cannot happen if $f$ is injective.