Solution (source code)

= Solution

If $f$ is <injective function>[injective] and $x\in f^{-1}(f(A))$, then $f(x)=f(a)$ for some $a\in A$, so injectivity gives $x=a\in A$. The reverse inclusion always holds; hence $f^{-1}(f(A))=A$.

Conversely, if (ii) holds and $f(x)=f(y)$, then $y\in f^{-1}(f(\{x\}))=\{x\}$, so $x=y$. Thus (i) and (ii) are equivalent.