$ f(x) = \frac{1}{x} $
$ g(x)= \begin{cases} -1 & -\infty \lt x \lt 0 \\ 1 & 0 \lt x \lt \infty \end{cases} $
$ g(f(x)) = \begin{cases} -1 & -\infty \lt \frac{1}{x} \lt 0 \\ 1 & 0 \lt \frac{1}{x} \lt \infty \end{cases} $
Here in the composite function $g(f(x))$, I am not able to understand how to evaluate the inequalities $-\infty \lt \frac{1}{x} \lt 0$ and $0 \lt \frac{1}{x} \lt \infty$
Can someone please explain?
$g$ is just the sign function.
If $x$ is positive, $\frac{1}{x}$ is positive as well.
If $x$ is negative, $\frac{1}{x}$ is negative as well.
Hence $g(f(x)) = g(x)$.
Edit:
To solve for $ \frac1x < 0 $, multiply $x^2$ throughout, hence we obtain $x < 0$. The same approach can be used to solve for $\frac1x > 0$.