How do you prove the domain of a function?

You do not and can not prove the domain of a function, you specify it (either explicitly or implicitly) for the function you're discussing.

The function $f(x)=x+2$ is defined for all $x \in \Bbb R$ and hence its domain may be $\Bbb R$. However, you may also define the function $g(x) = x+2$ for $g: [0,1] \to [2,3]$ and then the domain of $g$ is simply $[0,1]$, even though it can be extended to $\Bbb R$.

Also, note that the function $f$ is also defined for all $x \in \Bbb C$ and hence its domain could also be said to be $\Bbb C$.


Yes, absolutely, it should be defined. I had the same experience with my high-school teacher who actually got mad. I do not remember exactly, but apparently it is assumed (without stating) that the domain is the largest possible set on which the (rational, real, complex?) function is defined. I mean, something like $\sqrt{x-4}$ could als be defined on $[2014,\infty)$. So always ask for a specification of the domain.