Notation of a function For a reciprocal function:
$$f(x)=\frac{1}{x}$$ the domain is given by
$\operatorname{Domain}(f)=\Bbb R-\{0\}$ and the range by $\operatorname{Range}(f)=\Bbb R-\{0\}$.
But while writing the function we write  

"$f\colon \Bbb R-\{0\}\to \Bbb R$ such that $f(x)=\frac{1}{x}$ for all $x \in\Bbb R-\{0\}$"  

Why dont we write $f\colon \Bbb R-\{0\}\to \Bbb R-\{0\}$, as the range is $\Bbb R-\{0\}$?
 A: The range of the function does not need to be all of the numbers it does reach, it can be more. That's why we have a special name for functions which do cover the entire domain, and that name is "surjective".
In your case, the range of $f$ is $\mathbb R$, and the function is not surjective. You can also define the range to be $\mathbb R\setminus \{0\}$, in which case you actually defined a different function, this time it is surjective.
A: You could write $f: \mathbb{R} \setminus \{ 0 \} \to \mathbb{C}$ as well. It could be any set that includes all image values.
I would prefer $\mathbb{R}$ over $\mathbb{R} \setminus \{ 0 \}$ as well, as you have to start your analysis at $\mathbb{R}$ and $\mathbb{R}$ is the main theater of war here.
Note: This implies a view which considers both functions, despite the different codomains, as equal (as they have the same domain and same graph).
A: Some theory about functions.
If $f:X\to Y$ is a function and its range $R:=\{f(x)\mid x\in X\}\subseteq Y$ then for any set $S$ with $R\subseteq S\subseteq Y$ we also have a function $g:X\to S$ that is prescribed by $x\mapsto f(x)$. 
The graph of function $f$ is the set $G_f:=\{\langle x,y\rangle\in X\times Y\mid y=f(x)\}$.
The graphs of $f$ and $g$ coincide, so if functions are identified with their graphs then there is no essential difference between $f$ and $g$. 
There are fields in mathematics where this is common (e.g. sets). 
Also there are fields where it is common to identify function $f$ with triple $\langle X,G_f,Y\rangle$ (e.g. categories) and in that perspective $f=\langle X,G_f,Y\rangle$ and $g=\langle X,G_g,S\rangle$ are distinct functions if $S\neq Y$.
