Notational clarifications for an exercise to show that $f$ is onto iff $2^{f}$ is one-to-one The following question, is taken from Arbib and Manes’ Arrows, structures and functors text:

Let $2^{A}$ define the power set of all subsets of $A$. Given $f \colon A\rightarrow B$ define $2^{f} \colon 2^{B}\rightarrow 2^{A}$ by  $2^{f}(S)=f^{-1}(S)=\{a\in A \mid f(a)\in B\}.$ Prove that $f$ is onto iff $2^{f}$ is one-to-one.

I am not sure how to interpret the notation: $2^{f}(S)=f^{-1}(S)=\{a\in A \mid f(a)\in B\}$.
Usually the power set of $A$ is denoted by $P(A)=\{X \mid X\subset A\}$, but for the power set of all subsets of $A$, does $2^{A}$ then mean $P(P(A))=\{W \mid W\subset P(A)\}$?
Also for $2^{f}(S)=f^{-1}(S)=\{a\in A \mid f(a)\in B\}$, what does the set $S$ has to do with $f$’s domain and codomain? I would expect to see $f^{-1}(B)$ instead of $f^{-1}(S)$, unless $S\subset B$. Can someone please clarify this question’s notation to me? Thank you in advance.
 A: I think the correct statement should be

Let $2^X$ be the power set of the set $X$, the set of all subsets of $X$. Given $f:A\rightarrow B$ define $2^f:2^B\rightarrow2^A$ by $2^f(S)=f^{-1}(S)=\{a\in A|f(a)\in S\}$. Prove that $f$ is onto iff $2^f$ is one-to-one.

This is now well defined and true and your version is certainly wrong for 2 reasons. First, $\{a\in A|f(a)\in B\}=A$, which means that $2^f$ is constant and never one-to-one whenever $A\neq\emptyset$. There certainly exist non-empty onto functions. Secondly, if we tried to fix the definition of $2^f$ with $2^f(S)=f(S)$, then $2^f$ being one-to-one would imply that $f$ is one-to-one. So that way of fixing it is wrong.
Proof of my fixed version:

 We will prove 2 parts: (1) $f$ is not onto $\Rightarrow$ $2^f$ is not one-to-one; and (2) $f$ is onto $\Rightarrow$ $2^f$ is one-to-one. (1): There exists $b\in B$ such that there is no $a\in A$ for which $f(a)=b$. Then $2^f(\emptyset)=2^f(\{b\})$ so $2^f$ isn't one-to-one. (2): Let $X$ and $Y$ be 2 different subsets of $B$ and without loss of generality let's assume that $X\setminus Y\neq\emptyset$. Take some $x\in X\setminus Y$. There is some $a\in A$ such that $f(a)=x$. Then $2^f(X)=f^{-1}(X)\supseteq f^{-1}(\{x\})\ni a$ but $2^f(Y)=f^{-1}(Y)\not\ni a$, because otherwise it would mean $f(a)\in Y$, i.e. $x\in Y$ which is not. This means that $2^f(X)$ and $2^f(Y)$ aren't equal, meaning $2^f$ is one-to-one.

