$f(A)=\left\{f(x):x\in A\right\},f^{-1}(B)=\left\{x\in X:f(x)\in B\right\}$ Let $f:X\to Y$ be a function.For $A\subset X$ and $B\subset Y$,define $f(A)=\left\{f(x):x\in A\right\},f^{-1}(B)=\left\{x\in X:f(x)\in B\right\}$ then which of the following is true?
$(A)f^{-1}(f(A))\supseteq A\hspace{1cm}\forall A\subseteq X,$where equality holds iff $f$ is one-one.
$(B)f^{-1}(f(A))\supseteq A\hspace{1cm}\forall A\subseteq X,$where equality holds iff $f$ is onto.
$(C)f^{-1}(f(A))\subseteq A\hspace{1cm}\forall A\subseteq X,$where equality holds iff $f$ is one-one.
$(D)f^{-1}(f(A))\subseteq A\hspace{1cm}\forall A\subseteq X,$where equality holds iff $f$ is onto.

I could not do much in this question,I cant even properly understand it.Please help me.
 A: The key to understand these is that you can start with $x \in A \Rightarrow f(x) \in f(A) \Rightarrow x \in f^{-1}(f(A)) \Rightarrow A \subseteq f^{-1}(f(A))$, and the equality occurs if $f$ is one-to-one. Thus choice $A)$ has to be true. In order to see the one-to-one of $f$ plays into the proof, you realize the step that you need to show: $f^{-1}(f(A)) \subseteq A$. Let $x \in f^{-1}(f(A)) \Rightarrow f(x) \in f(A) \Rightarrow f(x) = f(a)$ for some $a \in A \Rightarrow x = a\Rightarrow x \in A$ since $f$ is one-to-one. Thus $f^{-1}(f(A)) \subseteq A$, and together with the first part, you have $A = f^{-1}(f(A))$.
A: Let $x \in A$. Let $y = f(x)$. Then  $y = f(x) \in f(A)$.  Then, as $y = f(x)$ and $y \in f(A)$, it follows that $x \in f^{-1}(f(A))$. Therefore $A \subseteq f^{-1}(f(A))$.
But is it a proper subset?
Let $w \in f^{-1}(f(A))$ but maybe $w \notin A$.  Then there some $y \in  f(A)$ such that $f(w) = y$. As $y \in f(A)$, there exists some $x \in A$ such that $f(x) = y$.  So $f(w) = f(x)$.  Does it follow that $x = y$?  If $f$ is one-one the $w = x \in A$ and $A = f^{-1}(f(A))$. But if $f$ is not one-one, $w$ need not equal $x$ and $w$ need not be in A.  (Consider $f(x) = x^2$ and $A = [0, \infty)$.  $(-1)^2 = (1)^2$ so $-1 \in f^{-1}(f(A))$ but $-1 \notin A$)
So if $A \subseteq f^{-1}(f(A))$ with equality holding if $f$ is one-to-one.
Okay.  Now I have to admit I must be missing something. Because the only choice we are given is "if and only if".  And I don't see the "only if" part.  Let $A = $ the Real numbers.  Let $f(x) = x^2$. Then $B = [0, \infty)$ and $f^{-1}(f(A)) = A$.  So "only if" doesn't seem to hold to me.  Maybe I'm missing something.
======
Ah I see!  The are saying not that equality holds for some A, but for all A.
Okay, proving the "only if part":
Suppose $f$ were not one-one.  Then there exist some $x, w; x \ne w, f(x) = f(w)$.  Find a subset A that contains $x$ but doesn't contain $w$.  Then $w \in f^{-1}(f(A))$ but $w \notin A$.  So equality "only if" f is one-to-one.
So in my supposed counter example. "Let $f(x) = x^2$. Then $B = [0, \infty)$ and $f^{-1}(f(A)) = A$." I could then find A' = all the reals except -1 (or better yet $[0, \infty)$). So $f^{-1}(f(A'))$ is still the Real Numbers but $A' \ne $ the Real Numbers.
