I don't think anyone has actually responded to this; and my impression is that you are saying you asked your friend independent of our discussion, and perhaps even before asking us, so there is no disparagement at all. Right?
Yes, i asked a week ago. He didn't respond at the time. So i came on the forum
The only issue here is that he ends up going far beyond the context of your question (and potentially just showing off his greater knowledge, without really helping you, though I am not going to presume anything about motivation).
I am not sure his motivation either!
Now, I am assuming you asked exactly the question you submitted here, so that the answer, "Technically you should exclude both," means that the domain is all real numbers except 0 and -1. I'm not sure of the reason for the word "technically". He is calling the domain of g X and the range Y (well, really that would be the codomain). What we call the domain of a function, when none has been specified and the context assumes real numbers, is the largest subset of the reals on which the function can be defined.
yes exactly the same question
Then he is calling the domain and range of f Y and Z (but actually restricting Y, and then X, beyond what is required by f in order to accommodate the composition; I would have been clearer about that). What we have is a chain of functions X--(g)-->Y--(f)-->Z; f forces Y to exclude -2, and then g forces us to exclude from X the value x for which g(x) = -2, namely -1, in addition to 0, which g itself requires.
The stuff about infinity is silly; he's talking about extending the real numbers, which you can ignore since your context is only real numbers. So ignore the last three paragraphs.
Thanks , Thats the bits i didnt get!