I understand that the domain is typically defined as the set of objects for which a function is defined. So, given a function $f(x) = x$, how can I figure out its domain? Is $bananas$ part of the domain, given that the function seems to defined for $bananas$ in that $f(bananas) = bananas$? Indeed, is the domain simply everything for this function?


I am told that I should specify the domain and codomain as part of the definition of a function, and use something like $f: A \to B : x \mapsto f(x)$. So is $A$ here the domain and $B$ the codomain?

Also, can I say $f : \mathbb{R}\setminus{\{0,1\}} \to \mathbb{R} : x \mapsto \frac{1}{x}$?

  • 2
    $\begingroup$ A function comes equipped with a domain, so if $bananas$ is an element of that domain, then sure. $\endgroup$ – Nick D. Mar 13 '17 at 17:44
  • 2
    $\begingroup$ If you only know the formula $f(x) = x$, then you do not have the full definition of the function, which must also include the domain and codomain. So without further context, your question is unanswerable. $\endgroup$ – Bungo Mar 13 '17 at 17:45
  • 1
    $\begingroup$ Nitpicking: $f(x)=x$ isn't even a function, it's an equality. If you get rid of the notational abuse, does the question remain? $\endgroup$ – Git Gud Mar 13 '17 at 19:48
  • $\begingroup$ Related. $\endgroup$ – Git Gud Mar 13 '17 at 20:02

When a person is to talk about a function "legally" then he should specify the domain, the codomain, and the corresponding rule of the function. From example, it is sloppy to write "the function $f(x) = x^{2}$" (though of course it would be okay if the context is clear enough); ideally the author might try to say instead "the function $f(x) = x^{2}$ from $\mathbb{R}$ to $\mathbb{R}$" or "the function $f: x \mapsto x^{2}: \mathbb{R} \to \mathbb{R}$". What we are given is merely the corresponding rule "$f(x) = x$" of a mysterious function $f$, so there is nothing much to say from there on.

  • 2
    $\begingroup$ I've never seen the notation “$f : x \mapsto x^2 : \mathbb{R} \to \mathbb{R}$” before. Maybe “$f\colon \mathbb{R} \to \mathbb{R}$, $x\mapsto x^2$” is more conventional. $\endgroup$ – Matthew Leingang Mar 13 '17 at 17:54
  • $\begingroup$ @MatthewLeingang, Yeah I think so :). You know sometimes for convenience I did that. At least I think it won't harm, for the transpose of the order does not cost any information loss. $\endgroup$ – Megadeth Mar 13 '17 at 17:56
  • $\begingroup$ @Bram28, Oh that would be a problem because $1/0$ is meaningless :). So at most $f: x \mapsto \frac{1}{x}: \mathbb{R}\setminus \{ 0 \} \to \mathbb{R}$. We have to get rid of $0$ in order we be consistent. $\endgroup$ – Megadeth Mar 13 '17 at 18:17
  • $\begingroup$ @EricClapton Thanks! ... and sorry for deleting that comment .. I thought it was better as an edit to my post. $\endgroup$ – Bram28 Mar 13 '17 at 18:21
  • $\begingroup$ @EricClapton So would you say that the domain is part of the definition of a function? $\endgroup$ – Bram28 Mar 13 '17 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.