Solution (source code)

= Solution

Assume $f$ is injective. The inclusion $f(A\cap B)\subseteq f(A)\cap f(B)$ holds for every function. If $y$ belongs to the right-hand side, write $y=f(a)=f(b)$ with $a\in A$ and $b\in B$. Injectivity gives $a=b\in A\cap B$, proving equality.

Conversely, suppose (iii) holds and $f(x)=f(y)$. If $x\ne y$, take $A=\{x\}$ and $B=\{y\}$. Then $f(A)\cap f(B)$ is nonempty whereas $f(A\cap B)=f(\varnothing)=\varnothing$, a contradiction. Hence $f$ is injective.