I'm pretty sure this is false, but this proof I came up with seems to be valid.
Proof.
If $f[X]=f[Y]$, then for any $x\in X$, $f(x)\in f[X]=f[Y]$, now $f(x)\in f[Y]=\{f(x)|x\in Y\}$, so $x\in Y$; hence $X\subseteq Y$. For any $y\in Y$, $f(y)\in f[Y]=f[X]$, so $y\in X$; hence $Y\subseteq X$.
But then this is a counterexample:
let $f(1)=2$, $f(0)=2$, $X=\{1\}$, $Y=\{0\}$, then $f[X]=f[Y]$ but $X\neq Y$.
Where is the mistake in the proof?
The fact that $f(x)$ belongs to $f[Y]$ does not imply that $x \in Y$. That part does not follow.