It depends on how you define what a function is (i.e., whether you take the set of ordered-pairs alone a la Bourbaki, or use something like the source-target predicate).
If you use the Bourbaki definition (i.e., $f\colon A\to B$ is $\{(a,f(a))\mid a\in A\}\subseteq A\times B$ and the Kuratowski ordered pair $(a,b)=\{\{a\},\{a,b\}\}$), then the codomain $B$ cannot be recovered from $f$.
On the other hand, if you build the codomain into the function as in source-target predicate, then you get the absolute value $\mathbb{R}\to\mathbb{R}$ and $\mathbb{R}\to\mathbb{R}^+$ are two different functions (which are related by the inclusion $\mathbb{R}^+\to\mathbb{R}$), which may or may not be what you want.