$X \xrightarrow{\quad f \quad } Y $
Given some function like the one above, why must the function have as the object on the left the domain which it must cover but have as the right hand object the codomain which $f$ need not be onto?
I have looked online and don't understand why we don't restrict $Y$ to be the image of which $f$ is onto.
I would assume that much like the distinction between partial functions and relations and functions, there is some edifice of theorems and axioms that may fall apart if we don't allow $Y$ to be an overset of the image of $f$.
However, I would like some concrete motivating examples of why we have chosen this as our criteria and or notation.
Thank you in advance for your help, I really appreciate this!