Composition of a piecewise function and another function I have this two functions. 
$f(x)=\arcsin \left(\dfrac{3-x}{3x-1} \right)$ and $g(x)=\begin{cases} 0 ;& |x| <\pi \\ \sin(2x);& |x| \ge \pi \end{cases}.$
I have to find $f \circ g$. 
I found out that $f$ has the following property;
$$f:(-\infty,-1] \cup [1,\infty) \to  \left[-\frac{\pi}{2},-\arcsin\left(\frac{1}{3}\right)\right) \bigcup \left(-\arcsin\left(\frac{1}{3}\right),\frac{\pi}{2}\right] $$ and 
$$g: \mathbb{R} \to [-1,1]$$
Now I don't know how to compute the composition. I know that $f \circ g = f(g(x)).$
 A: You can compose two functions iff the value mapped by the first function are included into the domain of the second function.
In this case the only values mapped by g which are included into the domain of f are +1,-1. 
The preimage of 1 by g is ${\{x = \pi/4 + k\pi \text{ where } k \text{ is an integer and } k \ne -1\} \\}$.
The preimage of -1 by g is ${\{x = -\pi/4 + k\pi \text{ where } k \text{ is an integer and } k \ne 1 \} \\}$.
Moreover 1 is mapped by f into $\pi/2$ and -1 is mapped by f into $-\pi/2$.
Thus 
${ f\circ g : \begin{array}{1} \pi/4 + n\pi \rightarrow \pi/2 \text{ for every n integer and } n \ne -1 \\ -\pi/4 + m\pi \rightarrow -\pi/2 \text{  for every m integer and } m \ne -1 \\ \end{array} }$
A: Hint:
If
$$g(x)=\begin{cases} 0& |x| <\pi \\ \sin(2x)& |x| \ge \pi \end{cases}$$
then
$$f(g(x))=\begin{cases} \arcsin \left(\dfrac{3-0}{3\cdot0-1} \right) & |x| <\pi \\ \arcsin \left(\dfrac{3-\sin(2x)}{3\sin(2x)-1} \right)& |x| \ge \pi. \end{cases}$$
Remains to find the domain, which is that of $g$ minus the values for which the argument of the $\arcsin$ doesn't work.
