2

If f is defined from set of integers to set of natural numbers, f(x)=|x| Then is f a function? Obviously it's not one-one but is it even a function? I got confused because 0 belongs to integers and f(0)=0 but 0 does not belong to natural numbers so 0 has no image under f, hence f is not a function. Thanks in advance.

1 Answers1

1

The answer depends on whether or not $0$ is included in the natural numbers. There are two conventions, one that is all positive integers and one that is all non-negative integers (see this question for more information). If you are taking the natural numbers to not include $0$ then you are correct that $f$ is not a function. This is because a function is a binary relation between two sets that associates every element of the first set to exactly one element of the second set. In your example, the $0$ in your domain is not associated with any element in the second set so it is not a function.

Saikat
  • 1,583
  • Specifically, if you consider $0\in\mathbb{N}$, then from the perspective of set theory $f:\mathbb{Z}\rightarrow\mathbb{N}$ means that $f$ is a relation from $\mathbb{Z}$ to $\mathbb{N}$ (i.e., a subset of $\mathbb{Z}\times\mathbb{N}$) in which the first element is unique. So $f = {\ldots,(-2,2),(-1,1),(0,0),(1,1),(2,2),\ldots}$. – Mike Jan 15 '21 at 18:07