Q:

Does $f:\mathbb{R}\to\mathbb{R}$ mean that $f$ maps to all reals?

This is a quick question. When people write $f:I\to J$ for instance, does $J$ need to be the range of $f$ or can it be any set containing the range of $f?$ For example, is $g(x)=\pi$ an $\mathbb{R}\to\mathbb{R}$ function?

A:

Usually, $f:A\to B$ means the domain of $f$ is $A$ and $\forall a\in A$, $f(a)\in B$. The map does not have to be injective or surjective. The range of $f$ is usually denoted as img$(f)$ or the image of $f$, which in this case is a subset of $B$.

A:

$f:X\to\Bbb R$ simply means that all of our function values are real. It doesn't mean that all real values are obtained by our function. ($\Bbb R$ in this case is called a codomain for our function $f$.) Your example $g$ is indeed an $\Bbb R\to\Bbb R$ function (so long as we require that $x$ is real, and allow $x$ to take on any real value), even though it's certainly not the case that all real values are obtained by $g$.

A:

Here's a point I would like to stress, though: You don't START with something like $g(x) = \pi$ and ASK if this is a $\mathbb{R} \rightarrow \mathbb{R}$ function. When you write $f:I \rightarrow J$, the sets $I$ and $J$ are part of the DEFINITION of the function. 
In other words, I could define a function $g$ by saying $g:\mathbb{R} \rightarrow \mathbb{R}$, $g(x) = \pi$. And I could define a function $h$ by saying $h:\mathbb{R} \rightarrow \{\pi\}$, $h(x) = \pi$. And these are DIFFERENT functions.

