What is wrong with this proof that $f(A_1 \cap A_2) = f(A_1) \cap f(A_2)$? Consider a function $f:A \rightarrow B$. Let $A_1, A_2 \subseteq A$.
Let $x \in$$(f(A_1) \cap f(A_2))$
$\implies x\in (\{f(x)\in B|x \in A_1\} \cap \{f(x)\in B|x \in A_2\})$
$\implies x\in (\{f(x)\in B|x \in A_1 $and $x\in A_2\})$
$\implies x\in (\{f(x)\in B|x \in (A_1 \cap A_2)\})$
$\implies x \in f(A_1 \cap A_2)$
$\implies f(A_1) \cap f(A_2) \subseteq f(A_1 \cap A_2)$
Now, let  $x \in$$f(A_1 \cap A_2)$
$\implies x\in \{f(x)\in B|x \in (A_1 \cap A_2)\}$
$\implies x\in \{f(x)\in B|x \in A_1 $and $x\in A_2\}$
$\implies x\in (\{f(x)\in B|x \in A_1\} \cap \{f(x)\in B|x \in A_2\})$
$\implies x \in (f(A_1) \cap f(A_2))$
$\implies f(A_1 \cap A_2) \subseteq f(A_1) \cap f(A_2)$
Therefore, $f(A_1 \cap A_2) = f(A_1) \cap f(A_2)$
But a simple counterexample to this would be $f: \{1,2,3\} \rightarrow \{1,2,3\}$, where $f(1) = 1, f(2) = 2$ and $f(3) = 1$. Let $A_1 = \{1,2\}$ and $A_2 = \{2,3\}.$
Then, $f(A_1 \cap A_2) = \{2\}$. But $f(A_1) \cap f(A_2) = \{1,2\}$.
Where did I go wrong with this "proof"?
 A: Your problem is in the second $\Longrightarrow$ of the first part of the proof.
$$\{y\in B : \exists x\in A_1 \text{ with } f(x)=y\} \cap \{y\in B : \exists x\in A_2 \text{ with } f(x)=y\} \neq \{y \in B: \exists x\in A_1 \cap A_2 \text{ with } f(x)=y\}  $$
$A_1,A_2$ may be disjoint but have some common images under $f$ e.g. $$f(x) = 1, A_1 = (0,1), A_2 = (2,3).$$
It follows that 
$$ f(A_1 \cap A_2) \subseteq f(A_1) \cap f(A_2)$$
but the reverse is wrong.
A: The error is in the first steps of the first part of the proof; from :

$x \in (f(A_1) \cap f(A_2))$

to :

$x \in ( \{ f(x) \in B | x \in A_1 \land x \in A_2 \})$.

From $x \in (f(A_1) \cap f(A_2))$ we can deduce that there exists $y_1 \in A_1$ such that $x=f(y_1)$ and that there exists $y_2 \in A_2$ such that $x=f(y_2)$, but we are not licensed to conclude that $y_1=y_2$, i.e. that they are "the same" element. 
Thus, we cannot conclude that $f(A_1) \cap f(A_2) ⊆ f(A_1 \cap A_2)$.
Consider the sets $A_1 = \{ -2 \}$ and $A_2 = \{ 2 \}$ and $B = \{ 4 \}$ with the function $f(x) = x^2$.
Clearly $4 \in f(A_1) \cap f(A_2)$ but $A_1 \cap A_2 = \emptyset$.
