prove f(A n B) = f(A) n f(B) iff f is one to one



Hello

suppose that f:X--->Y then prove that

f(A n B) = f(A) n f(B) (for all A,B which are subsets
of X ) if and only if f is injective ( that is one to one).

now we have to prove this in both directions. I am first
considering forward direction. That is to prove that f is one to one. Now first case I am considering is that A and B are disjoint sets. A n B = empty set. Now let x1 and x2 belong to X. Define A= {x1} , B= {x2}. since A and B are disjoint sets, x1 /= x2. Since A and B are disjoint,
A n B = phi .

f(A n B) = f(phi) = phi
But this is equal to f(A) n f(B) = phi.
which means f(A) and f(B) are disjoint.
f(A) = { f(x1) }
f(B) = { f(x2) }
so it follows that f(x1) /= f(x2)
which proves that f is one to one.
Now I am considering other cases to prove in forward direction.
A = non empty ; B = phi = empty

in this case how do I prove that f is one to one ?

Thanks
.