Domain of a function defined with another function Suppose $f(x)=\frac{1}{1+\frac{1}{x}}$, and $g(x)=\frac{1}{1+\frac{2}{f(x)}}$. To find the points not in the domain of $g(x)$, we obviously have to check the $x-$values where $f(x)$ becomes $0$ and $-2$, and count them first.
But where is the intuition behind considering the points for which $f(x)$ itself is undefined? On substituting $f(x)$ in $g(x)$, you get $g(x)=\frac{x}{3x+2}$. Why do we count the additional points where $f$ is discontinuous (in this case, the only extra one being $x=-1$, as $x=0$ is already necessary for $g(x)$'s denominator to be defined)?

We want to find when $g$ is undefined and this is when the denominator, $1+ \frac {2}{f(x)} = 0 $ which is only true when $f(x) = -2$. So then we check $-2 = \frac {1}{1+\frac{1}{x}} \implies 1+\frac {1}{x} = -\frac{1}{2}\implies x=-\frac {2}{3}.$ So $g(-\frac{2}{3})$ is not defined and $x = -\frac {2}{3}$ is not in the domain of $g$. Notice that $g$ is also not defined when $f(x) = 0$, but $f(x)$ never equals $0$ so this is not a problem. We must check where $f(x)$ is undefined now. This is when $1+ \frac{1}{x} = 0 \implies x = -1$. so then $g(-1)$ is not defined either. Also $f(0)$ is undefined since $\frac {1}{0}$ is undefined which means $g(0)$ is undefined. Hence the points not in the domain of $g$ are $x = -1, -\frac {2}{3},0$.
