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).

![Image](https://i.stack.imgur.com/sq0ev.png)

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

Source: [commons.wikimedia.org](http://commons.wikimedia.org/wiki/File:Codomain2.SVG)

**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?