properties of sets involving functions Suppose f is a function from X to Y and A, B are subsets of X, and suppose that S, T are
subsets of Y.
prove that $f(A\cap B) \subseteq f(A) \cap f(B)$.
my working:
let $x\in A\cap B$, then $f(x) \in f(A \cap B)$.
$x\in A$ and $x\in B$ so $f(x) \in f(A)$ and $f(x) \in f(B)$.
so $f(x) \in f(A) \cap f(B)$
Hence the forward direction is proved. However, somehow, the backward direction can also be proved.
let $x\in A$ and $x\in B$, so $f(x)\in f(A)\cap f(B)$
$x\in A\cap B$ so $f(x) \in f(A \cap B)$
How come the answer isn't an equal sign, and where did I go wrong, ie which step was invalid?
 A: You can prove the first inclusion based on the following auxiliary result:
\begin{align*}
A \subseteq B \Rightarrow f(A)\subseteq f(B)
\end{align*}
Indeed, if we assume that $A\subseteq B$, the next argument proves the proposed claim:
\begin{align*}
y\in f(A) & \Rightarrow (\exists x\in A = A\cap B)(y = f(x))\\\\
& \Rightarrow (\exists x\in B)(y = f(x))\\\\
& \Rightarrow y \in f(B)
\end{align*}
Based on it, it can be concluded that
\begin{align*}
\begin{cases}
A\cap B \subseteq A \Rightarrow f(A\cap B)\subseteq f(A)\\\\
A\cap B \subseteq B \Rightarrow f(A\cap B)\subseteq f(B)
\end{cases}
\end{align*}
Gathering both results, one arrives at the desired result:
\begin{align*}
f(A\cap B) \subseteq f(A)\cap f(B)
\end{align*}
On the other hand, the inclusion $\supseteq$ does not hold.
Take, for example, $A = [-1,0]$ and $B = [0,1]$, where $f:\mathbb{R}\to\mathbb{R}$ is defined as $f(x) := x^{2}$.
Considering such assumption, we get that
\begin{align*}
\begin{cases}
f(A\cap B) = f(\{0\}) = \{0\}\\\\
f(A)\cap f(B) = [0,1]
\end{cases}
\end{align*}
and $f(A\cap B)\not\supseteq f(A)\cap f(B)$ clearly.
Hopefully this helps !
A: You start the backwards direction like this:

let $x\in A$ and $x\in B$, so $f(x)\in f(A)\cap f(B)$

This isn't a general description of every element in $f(A)\cap f(B)$. It may be two different values $x\in A,y\in B$ that produce the same output, $f(x)=f(y)\in f(A)\cap f(B)$.
Other people have given explicit counterexamples. In each case, note how it is two different elements from $A$ and $B$ that map to the same output that cause the issue.
By seeing exactly which step in your "proof" is wrong, we can construct a very simple counterexample: $A=\{0\},B=\{1\},f(0)=f(1)=2$. Observe that $f(A)\cap f(B)=\{2\}\cap\{2\}=\{2\}$, but $f(A\cap B)=f(\emptyset)=\emptyset$. This is a common technique in "proof or counterexample" situations - try to construct a proof, and if a step of logic is faulty, that tells you something about how to make a counterexample.
A: Consider the example of the $f(x) = \sin(x) $ for $A = [0, 2\pi]$ and $B=[-2\pi, 0 ] $.
$$A\cap B = \{0\} $$
$$f(A) = [-1,1] $$
$$f(B) = [-1,1] $$
$$f(A\cap B) = f(\{0\}) = \{0\}$$
$$f(A)\cap f(B) = [-1,1] $$
Of course $\{0\} \not= [-1,1]$.
