g(x)=x+1x+2,x≠2g(x) = \frac{x+1}{x+2}, x \neq 2g(x)=x+2x+1,x=2
Let y = x, then g(y)=y+1y+2g(y) = \frac{y+1}{y+2}g(y)=y+2y+1
Let x = g(y), so that x=y+1y+2x = \frac{y+1}{y+2}x=y+2y+1
x(y+2)=y+1x(y + 2) = y + 1x(y+2)=y+1
xy+2x=y+1⇒xy−y=1−2xxy + 2x = y + 1 \Rightarrow xy - y = 1 - 2xxy+2x=y+1⇒xy−y=1−2x
y(x−1)=1−2x⇒y=1−2xx−1y(x - 1) = 1 - 2x \Rightarrow y = \frac{1 - 2x}{x - 1}y(x−1)=1−2x⇒y=x−11−2x
y=g−1(x)=1−2xx−1y = g^{-1}(x) = \frac{1 - 2x}{x - 1}y=g−1(x)=x−11−2x
g−1(2)=1−2(2)2−1=−3g^{-1}(2) = \frac{1 - 2(2)}{2 - 1} = -3g−1(2)=2−11−2(2)=−3