somewhat earlier correctly observed that a citation for that formal definition of equality with domain but not codomain could be useful in that discussion the citation i gave is from tom apostol calculus page but this is rather old looking in recent literature was very instructive the problem is that definitions of function equality in the literature seem rare somehow not found in about a dozen of recent math and cs books where such a definition could be expected googling on function equality or equal functions was equally ineffective but functions f and g are equal yields many results mostly lecture notes some definitions of function equality include codomain equality some do not here are a few that do not include codomain equality as requested an interesting subtlety many of the latter group define a codomain but do not include it in the definition of function equality as leibniz would say this means that they do not really consider the codomain as part of the definition of a function more subtle some talk about the domain of f but about the codomain without of f a pragmatic observation authors including a codomain say y in the definition of a function seem to do very little with it except i defining when a function is onto instead of onto y ii allowing it to restrict flexibility in the way functions can be combined for instance by composition