Need help with #81, specifically don’t understand how to determine the domain

ANSWERS
a) Domain: x ∈ (-∞, -1) ∪ (-1, ∞)
b) Domain: x ∈ (-∞, 0) ∪ (0, ∞)
EXPLANATION
These compositions are:
a)
[tex]f\circ g=f(g(x))=\frac{2}{g(x)}=\frac{2}{x+1}[/tex]And
b)
[tex]g\circ f=g(f(x))=f(x)+1=\frac{2}{x}+1[/tex]To find the domain in each function we have to find the values that x cannot take. If there aren't any, then the domain is all real values.
For composition a) note that x is in the denominator as (x+1). As we know, for real numbers the denominator can't be 0, so that's our restriction:
[tex]x+1\ne0[/tex]Solving for x:
[tex]x\ne-1[/tex]The domain for f º g is all real values except x = -1
For composition b) we have x in the denominator too, but it is alone. Therefore, as said before, x cannot be 0.