The domain of a function f: A → B is the set A — the collection of all allowed inputs. Every element of the domain must be assigned an output; a function is not permitted to leave any input unaccounted for.
In set theory, specifying a function requires specifying its domain, its codomain, and the assignment rule. Two functions with the same rule but different domains are different functions: “square each natural number” and “square each real number” are distinct, even where they agree.
In a category, the domain of a morphism f: A → B is the source object A. In the category of topological spaces, the domain carries a topology, and the function must be continuous with respect to it. In a model of first-order logic, the domain of discourse is the set of objects over which quantifiers range.