TITLE: Squaring a real valued function
QUESTION [6 upvotes]: There is a function f(x) defined as 
$$f(x)= \sqrt{x+1}$$
And we need to find its square that is $$f^2(x)$$
Or in other words we have to find $$f(x) × f(x)$$
What I am doing is :-
First I found the domain of f(x)
that is $$[-1,\infty)$$
Then I found the intersection of domains of f(x) and f(x) that is also equal to $$[-1,\infty)$$
And then we can write as :-
$$f^2:[-1,\infty)\to$$ R is defined by
$$f^2(x)=\sqrt{x+1}×\sqrt{x+1}$$
$$f^2(x)=x+1$$
My question is that in $f^2(x)$ we calculated the domain as $[-1,\infty)$ but we get $f^2(x)=x+1$ where we can put any real number so its domain should be R(real numbers). What am I misssing here???
Any help is highly appreciated.

REPLY [3 votes]: A lot of this is convention. But let's look carefully at what's going on anyway. Let
$$g(x) = \sqrt{x+1} \times \sqrt{x+1}$$
Then $g(-2)$ is undefined according to the usual convention for domains of functions defined by formulas (when only real numbers are considered).
Now it just so happens that for each $x \geq -1$ we have
$$g(x) \; = \; \sqrt{x+1} \times \sqrt{x+1} \; = \; x+1$$
Note that this equation does not hold for any values of $x$ that are less than $-1,$ since the left hand side is not even defined for any such value of $x.$
Therefore, for each $x \geq -1$ we have
$$g(x)=x+1$$
and for each $x < -1$ we have
$$g(x) \;\; \text{is undefined.} $$
Now let's suppose someone who hasn't seen any of this asks us to consider the function
$$h(x) = x + 1, $$
and nothing is said about the domain of $h.$
Both that person and we would agree, according the the usual convention for domains of functions defined by formulas, that $h(x)$ is defined for all real numbers $x.$ However, it would be incorrect to say that $g$ and $h$ are the same function, even though they are defined by using the same formula, because $g$ has a special restriction ABOVE AND BEYOND THE USUAL CONVENTION FOR DOMAINS OF FUNCTIONS DEFINED BY FORMULAS, namely $g(x)$ is only defined for values of $x$ greater than or equal to $-1,$ whereas $h(x)$ is defined for all real numbers $x.$
For a similar but more extreme example, consider the functions
$$G(x) \; = \; 0 \cdot \sqrt{-x^2 - 1} $$
and
$$ H(x) = 0 $$