Some functions are sometimes called mappings.
A usual notion of a function is a set of ordered pairs from domain to range,
it's easier to formalize this way and is a subset of the Cartesian product of
the domain and range, which is the function that way of each of the members
of the domain to each of the members of the range, there's a general notion
that functions have a left-hand-side and a right-hand-side, but more generally
they're just called image and co-image or domain and co-domain or images.
The usual notion of the set of ordered pairs (domain, range) is a quite usual
formalism because all the elements are elementary in terms of being sets
like point-sets.
It's a very usual notion of a function or mapping that there are 1-1 functions
and what they do is _carry_ from the domain to the range, especially continuous
functions, which have that any arbitrary region of the domain carries to a region
of the range, and, a sub-section of that carries to the corresponding sub-section
of the function/mapping/correspondence and similarly concatenations also so
carry. What today is called a continuous function is often enough what classically
was called a function and the most usual working set of those is what are called
classical functions, in a world with continuous functions and also discontinuous
functions which though for example have cases of functions both continuous
and discontinuous according to various things like Dirichlet problem, and
Poincare's rough functions.
Then, these notions of functions and mappings and correspondences, as written
as ordered pairs (if not, each written as there are infinitely many, written as
expressions in the sets of same), also see that there are some functions or
correspondences or mappings that aren't Cartesian, my favorite example of
course being the natural/unit equivalency function, which is non-Cartesian,
and stands out among objects that behave like functions, as that its range is
a continuous domain while its domain is the natural integers, but it can't be
taken apart like usual Cartesian functions, instead that its properties as a mapping
and the relations between its elements, and their relations to each other in terms
of being a continuous domain, are a special sort of unique and central: function,
in mathematics.
Various conjectures in number theory are yet undecided, and also, some may be:
undecideable, or rather that either there are higher axioms of the usual sort of
notions of deciding them, or, there are deconstructive accounts of arithmetic
and the nature of continuity like the Dirichlet problem and Poincare's rough plane,
that basically various laws of large numbers define what are these functions,
variously, though they'd have the same expressions in the language of arithmetic.
So, functions, or, families of relations that relate LHS-RHS domain-codomain,
have that relations are fundamental and as well that sometimes, the transfer
principle applies, and it's only about relating contiguous regions of the domains,
where contiguous suffices to include continuous, which is usually vice-versa,
what "defines" the functions.
Then, it's usual that for any function like "a function R -> R", that usually enough,
any subset of the domain maps to a subset of the range, for 1-1 functions or mappings.
Ditto, any usual extension of the domain brings along without further qualification,
all the semantics according to the language the expression in arithmetic is, in.
So, carefully distinguishing a function as including its domain and range and its
expression or the framework what establishes its mapping, is quite a usual enough
thing, but, there are higher (and lower) mathematics where it either needs be _further_
qualified, or, that it _excludes_ some what "are" mappings or correspondences or functions.
That said it's usually acceptable that the expression itself in the variables in the language
of arithmetic is the function, given that arithmetic usually has very well-known domains,
and that various laws of large numbers and various topologies and various corresponding
measure-theoretic aspects and as about various definitions of continuity and discontinuity
in functions and in the domains, that a more careful definition of reducing it to bounds,
then is just to make it easier to write things like "my Fourier-style analysis shows this
windows and boxes down to these bounds so these functions are the same", in bounds.
So, functions and quantities are in a sense sort of overloaded, because mathematics has
various ways of looking at what _are_ the elementary elements at all, and there are various
theories like arithmetic and the objects of arithmetic, various algebras and their objects,
various correspondences as domains, various topologies, usually pretty much one geometry,
but many various style methods in the numerical and algebraic, which result why what are
elements in one of these sub-fields are approximations or "only after completions", ..., in
others, so that if you actually care about rigorous definition of these terms in these other
terms, that such definitions are made stated, and, as part of entire derivations.
It does help keep most simple things simple and some otherwise capricious
things to make for writing things like "this limit is this sum" and so on. I.e.,
it's for matters of extensionality in systems of bounds, and otherwise wouldn't
need such qualification.
So, it's for keeping various simple things correct, not, "the end-all be-all".
In mathematics the definition of "function" has seen changes, but as elementary,
it is relations, and carries, for example, transfer principle correspondences.