What's wrong with this supposedly very simple proof about elementary set theory? The following is a simple result in elementary Set Theory:
Given $f:A\to B, \,\,X_1,X_2⊆A$, then $f(X_1 \cap X_2) ⊆ f(X_1) \cap f(X_2)$, and it's not necessarily the case that $f(X_1 \cap X_2) = f(X_1) \cap f(X_2)$
I'm aware of the proof of the first fact (and the disproof of the second fact). However, I don't know what's wrong with a proof I'll give to the following false statement:
[False statement]
Given $f:A\to B, \,\,X_1,X_2⊆A$, then $f(X_1 \cap X_2) = f(X_1) \cap f(X_2)$
Before I give the incorrect proof, I'll first prove a possibly false lemma (possibly false because I really don't know its truth value, though I suspect it is true)

(Possibly incorrect) Lemma:$\{x : (x ∈ S) ∧ (x ∈ T)\} = \{x : x ∈ S\} ∩ \{x : x ∈ T\}$
(Possibly incorrect) Proof of the lemma:
Any set $S$ can be expressed as $\{x : x \in S \}$, so it follows that:
$(1) \,\,\, S = \{ x : x \in S \}$
$(2) \,\,\, T = \{ x : x \in T \}$
By $(1)$ and $(2)$, it follows that:
$S \cap T = \{ x : x \in S \} \cap \{ x : x \in T \}$
By definition of set intersection:
$S∩T ≜ \{x : (x ∈ S) ∧ (x ∈ T)\}$
Therefore:
$\{x : (x ∈ S) ∧ (x ∈ T)\} = \{ x : x \in S \} \cap \{ x : x \in T \} ∎$

Now I present the definitely incorrect proof:
[Incorrect Proof]:
By definition of the image of a set under a function f:
$f(X_1 ∩ X_2) ≜ \{f(x) : x ∈ (X_1 ∩ X_2)\}$
The statement "$x ∈ (X_1 ∩ X_2)$" is equivalent to the statement "$(x ∈ X_1) ∧ (x ∈ X_2)$", so we can substitute:
$f(X_1 ∩ X_2) = \{f(x) : (x ∈ X_1) ∧ (x ∈ X_2)\}$
By the lemma:
$\{f(x) : (x ∈ X_1) ∧ (x ∈ X_2)\} = \{f(x) : (x ∈ X_1) \} \cap \{f(x) : (x ∈ X_2)\}$, so we can substitute:
$f(X_1 ∩ X_2) = \{f(x) : (x ∈ X_1) \} \cap \{f(x) : (x ∈ X_2)\}$
By definition of the image of a set under a function f:
$f(X_1) ≜ \{f(x) : x ∈ X_1 \}$, and $f(X_2) ≜ \{f(x) : x ∈ X_2 \}$, so we can substitute:
$f(X_1 ∩ X_2) = f(X_1) \cap f(X_2) ∎$

What exactly is wrong with this proof? Until now, my exposure to formal proofs in Mathematics was only through The Book of Proof (Richard Hammack), so I definitely lack a lot of skills, though I plan to improve my knowledge of proofs by reading other books.
I'd be glad to know where my thinking went astray here. Thank you very much!
 A: The issue lies in the application of the lemma. Notice that it presupposes that you have the form
$$\{x : x \in S\}$$
whereas you're trying to apply it to something of the type
$$\{y : x \in S\}$$
To see this, let
$$\begin{align*}
A &= \{f(x) : (x ∈ X_1) ∧ (x ∈ X_2)\}\\
B &=\{f(x) : (x ∈ X_1) \} \cap \{f(x) : (x ∈ X_2)\}
\end{align*}$$
Then:
$$\begin{align*}
y \in A
\iff& \text{$y=f(x)$ for some $x$ such that $x \in X_1 \land x \in X_2$} \\
\iff& \text{$y=f(x)$ for some $x$ such that $x \in X_1 \cap X_2$} \\
y \in B
\iff& y \in \{f(x) : (x ∈ X_1) \} \text{ and } y\in  \{f(x) : (x ∈ X_2)\} \\
\iff& \text{$y = f(x_1)$ for some $x_1 \in X_1$ and $y=f(x_2)$ for some $x_2 \in X_2$} \\
\end{align*}$$
These are not identical claims: in the $A$ case, the $x$ needs to lie in $X_1$ and $X_2$ (and thus be the same element in each!); in the $B$ case, the $x$ such that $y\in B$ could be different between the $X_1$ and $X_2$ cases. It's possible that the $x_1,x_2$ are in fact the same, i.e. $x_1 = x_2 = x \in X_1 \cap X_2$ for some $x$, but that need not hold.
A: This is is basically the same as PrincessEev's answer, but written out a little less formally.
For equality of sets, a strategy is to prove that each is a subset of the the other. It may be easier to think in terms of elements, like this.
Firstly, let's tackle $f(X_1 \cap X_2) \subseteq f(X_1) \cap f(X_2)$.
Let $y\in f(X_1 \cap X_2)$. Then there is some $x \in X_1 \cap X_2$ such that $y = f(x)$. Since $x \in X_1 \cap X_2$, $x\in X_1$, so $y\in f(X_1)$. Also $x\in X_2$, so $y\in f(X_2)$.
In summary, if $y\in f(X_1 \cap X_2)$ then $y\in f(X_1)$ and $y\in f(X_2)$; hence $y\in f(X_1) \cap f(X_2)$. This shows that $f(X_1 \cap X_2) \subseteq f(X_1) \cap f(X_2)$.
Now let us try to show that $f(X_1) \cap f(X_2) \subseteq f(X_1 \cap X_2)$.
Suppose $y\in f(X_1) \cap f(X_2)$. Then $y\in f(X_1)$, so there is some $x_1\in X_1$ such that $y = f(x_1)$. Also there is some $x_2\in X_2$ such that $y = f(x_2)$.
Now we are stuck with nowhere to go. There is no reason to suppose that $x_1 = x_2$.
At this point, try to construct a simple counter-example!
