Give an example of sets $X,Y$, subsets $A,B \subseteq X$ and a function $f:X→Y$ such that $f[A \cap B ] \neq f[A] \cap f[B]$
I'm not sure if I'm right for the first part,
I have $X= \{1,2,3\}$ and $Y= \{1,2,3,4,5\}$.
For the second part of the question, I'm not sure how to find a function.
Famously Lebesgue made the error of assuming $f[A \cap B] = f[A] \cap f[B]$ for projections $f$ (in fact it was actually a countable intersection instead of a finite one, like here).
In that spirit, I'll give a counterexample where $f$ is a projection. Let $X = \mathbb{R}^2$ and $Y = \mathbb{R}$, and use $f(x,y) = x$, projection onto the $x$-axis. Then, take $A = [0,2] \times [0,2]$ and $B = [1,3] \times [3,5]$ as shown below.
$A \cap B = \emptyset$ so $f[A \cap B] = \emptyset$, but $f[A] = [0, 2]$ and $f[B] = [1,3]$, so their intersection is $[1,2] \neq \emptyset$.