What is the preimage of the codomain of a function? First, I wan't to make clear that we use the same terms:
$X, Y$ are sets with $X \neq \emptyset$ and $Y \neq \emptyset$.
$f:X \rightarrow Y$ is a funtion.
$f^{-1}(A)$ is the preimage of $A \subseteq Y$ (and NOT the inverse function).


$f$ is a function from domain $X$ to codomain $Y$. The smaller oval inside $Y$ is the image of $f$.

Source: commons.wikimedia.org
Question:
What is the preimage of the codomain of a function if the function is not surjective?
Example:
$f: \mathbb{R} \rightarrow \mathbb{R}$
$f(x) := x^2$
a) $f^{-1}(\{-1,1,2\}) = \{1, \sqrt{2}, -1, \sqrt{2}\}$ and especially $f^{-1}(\{-1\}) = \emptyset$ or
b) $f^{-1}(\{-1,1,2\})$ is undefined, as $-1$ has no preimage?
Which one is correct? Does it depend on the author? 
 A: Definitely (a).  The definition of preimage is $f^{-1}(A) = \{x \in X : f(x) \in A\}$ so it's defined for all subsets $A \subset Y$, regardless of how $A$ relates to the image of $f$.
A: I definitely go with (a).
Note that Wikipedia says the following: 

The inverse image or preimage of a particular subset $S$ of the codomain of a function is the set of all elements of the domain that map to the members of $S$.

Put into set-theoretic notation $$f^{-1} ( S ) = \{ x \in X : f(x) \in S \}.$$
There is no requirement that everything in $S$ is in the range/image of $f$.  (Actually, the attentive reader should note that the same definition could be used even if the set $S$ is not a subset of the codomain.  And this makes sense since "codomain" is an indefinite concept (set-theoretically speaking).  What is the codomain of $x \mapsto x^2$?  Is it $\mathbb{R}$? $\mathbb{R}^{\geq 0}$?  $\mathbb{C}$?)
A: This emended picture from http://yorkporc.wordpress.com/2011/05/28/transforms-pre-images-and-kernels-and-null-spaces/ should avail.

The pink is the preimage/inverse image of $S \subseteq Y$ (though this picture shows $S \subsetneq Y$) under $T$ $= T^{-1}[S] = \{x \in X : T(x) \in S\}$.
Moreover, it evinces Arthur Fischer's statement: "There is no requirement that everything in $S$ is in the range/image of $f$." In $Y$, the pink is strictly smaller than $S$ thus $T(T^{-1}[S]) \subsetneq S$ here.
