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 54 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