Show $S = f^{-1}(f(S))$ for all subsets $S$ iff $f$ is injective Let $f: A \rightarrow B$ be a function. How can we show that for all subsets $S$ of $A$, $S \subseteq f^{-1}(f(S))$? I think this is a pretty simple problem but I'm new to this so I'm confused.
Also, how can we show that $S = f^{-1}(f(S))$ for all subsets $S$ iff $f$ is injective?

Let $x\in S$. Then $f(x)\in f(S)$, so that $x\in f^{-1}(f(S))$.
Suppose $f$ is injective. Let $x\in f^{-1}(f(S))$. Then $f(x)\in f(S)$, so that $f(x)=f(y)$ for some $y\in S$. It follows that $x=y\in S$.
Suppose $f$ is not injective. Then $f(x)=f(y)=a$ for some $x\neq y$, so that $\{x,y\}\subset f^{-1}(f(\{x\}))$. It follows that $f^{-1}(f(\{x\}))\not\subset \{x\}$.
