(edited)Which $f$ can satisfy $f(A)=f(B) \to A=B$? As I wrote in title,
What is the necessary and sufficient relation between function $f$ and set $A,B$  which can satisfy
$f(A)=f(B) \to A = B\\ where f(A) =\{f(x)\|x\in A\}, f:X\to X$
and is it possible for above $f$ to make $f(A)$ and $f(B)$ intersect while A and B aren't?
edited) I know what injectivity is but what i am asking is the condition that even 
$f(x_1) = f(x_2) \land x_1 \neq x_2$ happened,  it is okay if $x_1,x_2 $ are in both $A$ and $B$

Try to prove:
$f$ is injective $ \iff$ for all subsets $A,B$ of $X$ we have that $ f(A)=f(B)$ implies $A=B$:
