I recommend an excellent account by Luzin in the Monthly: MR1615544, MR1613935
(American math Monthly 105 (1998), 1 59-67 and 3, 263-270.
It is usually overlooked that there are actually several different notions of function in modern mathematics. One is the Dirichlet's definition which is usually cited (where two sets are given X and Y, and a rule which to each element of X puts into correspondence an element of Y). Notice that X is a part of the definition!
So the problem of the type "find the domain of $\log((x-1)(x-2))$ makes no sense from the point of this definition.
In 18 century, Euler understood a function as some analytic expression whose domain is not given in advance. This different notion (from Dirichlet's definition) is not "out of date". It evolved into a modern definition of an "analytic function". Roughly speaking, an
"analytic expression" has a "natural domain of definition", which is not given in advance.
And problems of the type "find the domain of definition" of an analytic function make perfect sense in modern mathematics.
There are also other notions of functions in modern mathematics (generalized functions, or distributions), which also do not fit in the Dirichlet definition. Moreover, these generalized functions are in some sense closer to what physicists and engineers mean by a function than the Dirichlet definition.