TITLE: Prove that equality holds only if $f$ is one-to-one.
QUESTION [5 upvotes]: I am just looking for a hint. Not a solution as I am just trying to solve these for fun. 
Let $f:A \rightarrow B$ with $A_0 \subset A$ and $B_0 \subset B$. Show that $$A_0 \subset f^{-1}(f(A_0))$$ but equality holds only if $f$ is injective.
Here is what I am thinking so far. I will choose two points $a_0,a^{\prime}_0 \in A_0$ with $a_0 \ne a^{\prime}_0$ and $f(a_0)=f(a^{\prime}_0)$. We have $$f^{-1}(f(a_0)) \in A_0 \implies a_0 \in f^{-1}(f(A_0))$$ $$f^{-1}(f(a^{\prime}_0)) \in A_0 \implies a^{\prime}_0 \in f^{-1}(f(A_0)) $$ $$\implies A_0 \subset f^{-1}(f(A_0)) $$ but $$f^{-1}(f(a_0)) \ne f^{-1}(f(a^{\prime}_0))$$
I am sort of stuck here. It looks as though I chose points that are both in the subset $A_0$ but it is possible that the pre-image of one may be outside of $A_0$ making the reverse containment impossible unless $f$ is one-to-one.

REPLY [5 votes]: Hope you've solved it by now, but here is a complete proof for others who may find themselves looking for answers
Showing the first inclusion is straight forward
def. $f(A) = \{f(x) : x \in A \}$
def. $f^{-1}(B) = \{x : f(x) \in B \}$

$x \in A \subset X$
$f(x) \in f(A)$
$f^{-1}(f(A)) = \{x : f(x) \in f(A) \}$
$x \in f^{-1}(f(A))$
$A \subset f^{-1}(f(A))$

Now all that needs to be shown is that if $f$ is injective $A \supset f^{-1}(f(A))$
def. $f:X \rightarrow Y$ is injective $\Leftrightarrow (f(x)=f(y) \implies x = y)$
Proof by contradiction. Assume the opposite

$A \not \supset f^{-1}(f(A))$ 
$\exists x \in f^{-1}(f(A)) : x \not \in A$
$x \in f^{-1}(f(A))$ and $x \not \in A$
$f(x) \in f(A)$ and $x \not \in A$
$y \in f(A) \Leftrightarrow \exists z\in A : f(z)=y$
$\exists z \in A : f(z) = f(x)$
$z = x$
$x \in A$ contradiction

Thus we have $A \supset f^{-1}(f(A))$ and thereby $A = f^{-1}(f(A))$