logic question : about the set equality $f(A)=B$ I argued with a friend about whether the equivalence :
$$x\in A \iff f(x)\in B$$ (where $f:E \to F$ is some function and $A \subset E$, $B \subset F$)
is enough to say that the set-equality $f(A) = B$ holds.
If we take the map 
$$ \begin{aligned}[t]
f \colon \mathbb{R}^* &\longrightarrow \mathbb{R} \\
x &\longmapsto \dfrac 1x \end{aligned} $$
If we take $A:=(0,+\infty)$ and $B=(0,+\infty)\cup \{0\}$ the equivalence sounds correct yet $f(A) \neq B$.
Thanks for any clarifications.
 A: $f(A) = B$ has two parts. $f(A) \subseteq B$ is equivalent to $x\in A\implies f(x)\in B,$ which is one direction of your statement. $B\subseteq f(A)$ means for all $y\in B,$ there is an $x\in A$ such that $f(x)=y.$ The reverse direction of your statement, which is $f(x)\in B\implies x\in A,$ does not imply this.
A: $x \in A$ iff $f(x) \in B$ can be written as $A=f^{-1}(B)$; in general this is not equivalent to $f(A)=B$. Of course the equivalence is true when $f$ is bijective. 
A: Suppose that $f~:~E\to F, A\subset E,B\subset F$ and further suppose that $(x\in A\iff f(x)\in B)$
Let $y\in f(A)$.  Then there exists some $x\in A$ such that $f(x)=y$.  By our assumption since $x\in A$ this implies that $f(x)=y\in B$.  As a result $f(A)\subseteq B$.
On the other hand, suppose that $y\in B$.  If we can somehow show that there must be some $x$ for which $f(x)=y$ then we would have by our assumptions that $x\in A$ and therefore $y\in f(A)$, however this is a leap in logic we cannot make.  There is nothing guaranteeing that $y\in f(E)$.

Consider an example: $A=E=\{1\}$ and $B=F=\{1,2\}$ and $f(1)=1$.  Here we have all of the conditions satisfied including the iff statement, however $f(A)\neq B$.
If we were to include in the hypotheses that $f$ must be surjective then the implication holds.
