I was solving a problem in section 5.4 of "How to Prove it Right" by velleman. Below are the problem and my answer. According to my inspection, $f$ didn't need to be one-to-one and onto. Did I miss anything?
- Suppose $f : A \to B$, f is one-to-one and onto, and $Y \subseteq B$. Show that the inverse image of $Y$ under $f$ and the image of $Y$ under $f^{-1}$ are equal. (Hint: First write out the definitions of the two sets carefully!)
If $Y \subseteq B$, then the inverse image of $Y$ under $f$ is $f^{-1}(Y) = \{a \in A \mid f(a) \in Y\}$. The image of $Y$ under $f^{-1}$ is $$f^{-1}(Y) = \{f^{-1}(y) \mid y \in Y\} = \{a \in A \mid \exists y \in Y(f^{-1}(y) = a)\} = \{a \in A \mid f(a) \in Y\}$$ Thus, they are equal even if f is not one-to-one or onto.
When you write $f^{-1}(Y) = \{ f^{-1}(y) | y ∈ Y \}$, you're tacitly assuming that $f$ is one-to-one and onto. In order for an $f^{-1}(y)$ to exist, $y$ must be in the image of $f$ (so you are assuming onto) and in order for this $f^{-1}(y)$ to be unambiguous, $f$ needs to be one-to-one.
Consider the situation where $A = \{ a_1, a_2, a_3 \}$, $B = \{ b_1, b_2, b_3 \}$, and $f = \{ (a_1, b_1), (a_2, b_2), (a_3, b_1) \}$. Then what is $f^{-1}(b_3)$? This question illustrates that your argument needs $f$ to be onto in order to work. Also, what is $f^{-1}(b_1)$? Is it $a_1$ or $a_3$? This question illustrates that your argument requires $f$ to be one-to-one.
EDIT: Perhaps we need some more explicit notation to tackle this problem appropriately.
Since $f$ is one-to-one and onto, $f^{-1}$ exists as a function from $B$ to $A$, and we can find $f^{-1}(b)$ for any $b \in B$.
Now, for any function $f$, we get an induced function on sets that we will call $Map_f$, so $Map_{f}$ is a function that takes a subset of $A$ and returns a subset of $B$ (rather than just elements), by the rule $Map_{f}(X) = \{ f(x) | x \in X \}$. We also always get a reverse mapping, we'll call it $RevMap_{f}$, which takes subsets of $B$ and returns subsets of $A$ by the rule $RevMap_{f}(Y) = \{ a \in A | f(a) \in Y \}$.
In this terminology, the problem asks you to show that $Map_{f^{-1}}$ and $RevMap_{f}$ are the same function when $f$ is invertible.
$RevMap_{f}$ always exists whenever $f$ is a function, whether or not $f$ is one-to-one and onto, but $Map_{f^{-1}}$ can only exist when $f^{-1}$ is a function, ie. when $f$ is one-to-one and onto. So, since the problem asks us to prove something about $Map_{f^{-1}}$, we do need $f$ to be one-to-one and onto.