Proving $f(C\cap D)=f(C)\cap f(D)$ and $f(C\cup D)=f(C)\cup f(D)$ 
Let $A,B$ be sets, $f:A\to B$ a function.
Prove/disprove: $\forall C,D\subseteq A$:
  
  
*
  
*$f(C\cup D)=f(C)\cup f(D)$
  
*$f(C\cap D)=f(C)\cap f(D)$

I disproved both but I'm not sure it's right:


*

*Let $C=\{1\}, D=\{2,3\}, A=\{1,2,3\}$ and $f(X)=\begin{cases}1 &,|X|\le 1\\ 
                                                               2 &,|X|\ge2  \end{cases}$


So $C\cup D=\{1,2,3\} so $ $f(C\cup D)=2$ but $f(C)\cup f(D)=\{1,2\}$


*Let $C=\emptyset, D=\{1\}, A=\{1,2,3\}$ and $f(X)=\begin{cases}1 &,|X|=0\\ 
                                                               2 &,|X|>0  \end{cases}$


So $C\cap D=\{1\}$ so $f(C\cap D)=1$ but $f(C)\cap f(D)=2$
 A: Both are wrong.
A function $f:A\to B$ is defined by what it does for each element of $A$. You don't get to specify for yourself what it does when applied to subsets of $A$. When $X\subseteq A$, then we always have
$$ f(X) = \{ f(x) \mid x\in X \} $$
And this is always a subset of $B$.
You can't make your own definition of this that depends on the size of $X$.
When you have $A=\{1,2,3\}$, your definition of $f$ should specify what $f(1)$, $f(2)$, and $f(3)$ are -- its operation on subsets will be derived from that.

Further errors: In (2) you say $C=\varnothing, D=\{1\}$, but state $C\cap D=\{1\}$. However, $\{1\}$ is the union of these $C$ and $D$, not the intersection.

In general you seem to fail to distinguish between, say, $2$ and $\{2\}$. Those are quite different things -- one of them is a number, the other is a set that contains a number. This confuses you in (1) where you think (incorrectly, as described above) that $f(C)=1$ and $f(D)=2$. Since $1$ and $2$ are numbers rather than sets, attempting to take $f(C)\cup f(D)$ should have alerted you that something is wrong because you can't take the union of two numbers. Instead you must have just reinterpreted them as $\{1\}$ and $\{2\}$, hiding the underlying problem.
A: The proof for 1st claim "$f(C \cup D) = f(C) \cup f(D)$". Proof:
For "$\subseteq$": For each element $x\in C \cup D$, either $x\in C$ or $x\in D$. WLOG we may assume that $x\in C$. Then we have $f(x) \in f(C) \subseteq f(C) \cup f(D)$. 
For "$\supseteq $": For each $y \in f(C) \cup f(D)$, by definition we have either $y\in f(C)$, or $y\in f(D)$. WLOG, assume that $y\in f(C)$, then $y=f(c)$ for some $c\in C$. Therefore $y= f(c) \in  f(C) \subseteq f(C\cup D)$, as desired.
A counter-example for 2nd claim：
Let $C=\{1,2\}, ~D=\{1,3\}$ and set $f(1)=1,~f(2)=2$ and $f(3)=2$. Then we obatain that 
$$ f(C\cap D) = f(\{1\}) = \{1\} \neq \{ 1,2 \} = f(C) \cap f(D).$$
