This remark appears in Terence Tao's Analysis I
Remark 3.3.6. Strictly speaking, functions are not sets, and sets are not functions; it does not make sense to ask whether an object $x$ is an element of a function $f$, and it does not make sense to apply a set $A$ to an input $x$ to create an output $A(x)$. On the other hand, it is possible to start with a function $f : X → Y$ and construct its graph $\{ (x, f(x)) : x \in X \}$ , which describes the function completely: see Section 3.5.
In a lot of books I checked (almost all of them about Set Theory) do consider $f$ to be a set defined as $f = \{ (x, f(x)) : x \in X \}$ which is included in $X \times Y$ (i.e The Cartesian product of $X$ and $Y$) and I don't see why Tao sees it as nonsensical?
One other thing, lets consider this two definitions:
(1) For each element $x \in A$, there exist at most an element $y$ in $B$ such that $(x,y) \in f$, $y = f(x)$, or $x f y$ depends on the notation used.
(2) For each element $x$ in $A$, there exist a unique element $y \in B$ such that $(x,y) \in f$, $y = f(x)$, or $x f y$ depends on the notation used.
In almost all French books I checked (1) is a definition of a they call "fonction" (i.e Function in English apparently), and (2) is for what they call "application" (I don't know what it should be translated to in English, I think 'map' would do), but in English books I checked they don't make this distinction, they define function, map...etc as in (2) and consider (1) to a not be a function.
My question is which one I should consider as a the definition for a function? even though (2) would make the most sense for me, because why would you include elements that not have an image in the domain of $f$?
Tao defines a function from $X$ to $Y$ to be a property $P(x,y)$ of elements $x \in X$ and $y \in Y$ such that for each $x$ there is exactly one $y$ making the property true.
Of course, this definition of a function as being a "property" without further clarification does not meet the standards of precision and rigour one would find in a construction of mathematics on the basis of set theory. Tao presumably feels that such a construction is inappropriate at the level of his book. Obviously, since a "property" is not a set, Tao is correct in saying that, according to his definition of a function, it is not a set.
With respect to the question of whether the domain of definition is all of $X$ or not, I will make the following observations.
The distinction between a function (fonction) and a mapping (application) that you refer to does indeed exist in France (or once existed), but only at school level, not in higher mathematics in general. The reason is that one wants to be able to refer to a function such as $f(x) = 1/(x-1)$ as being a function from $\mathbf{R}$ to $\mathbf{R}$, even though it is a mapping from $\mathbf{R} - \{1\}$ to $\mathbf{R}$. This distinction does not exist in English-speaking countries, as far as I am aware, and I don't know about other languages.
Even in France, other than in specific contexts, this distinction is not usually made by mathematicians. If one speaks of a function from $X$ to $Y$, one is saying that the domain of definition is all of $X$. One exception, to which Suzet alludes in a comment, is the theory of recursive functions, where one wants to be able to speak of a "partial function" from $\mathbf{N}$ to $\mathbf{N}$.
When the concept of a function is formalized set-theoretically, the most common approach is to define a mapping $f$ from $X$ to $Y$ as being synonymous with its graph, which is the set you define in (2).
This definition has much to be said for it, but it also has what some consider a serious deficiency. A graph $\Gamma$ could represent a function $f$ from a set $X$ to a set $Y$, but the same graph could also represent a function from $X$ to any other set $Y'$ containing $f(X)$. There are areas of mathematics, particularly those where category theory is often used, where this is inconvenient, and one would like to consider two mappings $f \colon X \to Y$ and $f' \colon X \to Y'$ with the same graph $\Gamma$ to be distinct objects. Consequently, Bourbaki defines the mappings $f$ and $f'$ to be the distinct triples $(\Gamma, X, Y)$ and $(\Gamma, X, Y')$, respectively. In this convention it has been followed by many authors, particularly in France where its influence has been greatest.