Hello,
As indicated in the legend at the bottom right of the figure, this is arbitrary. A function is an application from one set to an other set. To qualify as a function, this application must conform to the rules. From this, it results that the same application can be a function from set A to set B and not from set A to set C, nor from set D to set B.
This is what is illustrated in the figure. F1(x) is an application from N to N, but it is not a function. It would be a function from the set of even numbers to N. It would also be a function form N to Q. The intent (when not choosing Q as the target set) was to show that what looks like the same application may or may not be a function depending what source set and/or target set you chose.
The term "partial function" is sometimes used to qualify an application that would be a function if the source set was restricted or if the target set was extended. Partial functions often break programs. f(x) = 1/x is a partial function (which means it is not a function) form Z (signed integers including 0) to Q (fractional numbers). It is a function from Z* (Z without 0) to Q. It is also a function from Z to (Q + error).
Making programs safe is often a matter of changing partial functions into total ones, which means dealing with errors in the return value, and not as a side effect, like throwing exceptions. This is what chapter 6 is all about.
