Problem based on Composite Functions. Let $f(x) = \sin^{2}{x} + \sin^{2}\left(x + \frac{\pi}{3}\right) + \cos{x}\cos\left(x + \frac{\pi}{3}\right)$ 
and $g(x) = \left\{\begin{array}{rcc} 2x,\quad0\le x<1 \\x + \frac{1}{4},\quad 1 \le x<2  \end{array}\right.$ ,   then find $g\{f(x)\}$.
I am really confused on this one.
 A: At first, you have to realize that there are basically two caes you have to consider. The first one is when $0<f<1$. Then you compose the functions according to the rule you have written above, i.e., in the intervall for which the condition I have imposed on $f$ holds you write $g(f) = 2\cdot f$. When $1<=f<2$, you have to write: $g(f)=f + \dfrac{1}{4}$.
Then you're done. 
A: Note that $f(x)$ can be written as
$$f(x) = \sin^{2}{x} + \sin^{2}\left(x + \frac{\pi}{3}\right) + \cos{x}\cos\left(x + \frac{\pi}{3}\right)$$
$$=1-\cos^{2}{x} + 1-\cos^{2}\left(x + \frac{\pi}{3}\right) + \cos{x}\cos\left(x + \frac{\pi}{3}\right)$$
$$=2-\frac{3}{4}\cos^{2}{x}-\left[\frac{1}{2}\cos{x}-\cos(x+\frac{\pi}{3})\right]^2.$$
Since
$$\cos(x+\frac{\pi}{3})=\cos x\cos\frac{\pi}{3}-\sin x\sin\frac{\pi}{3}=\frac{1}{2}\cos{x}-\frac{\sqrt{3}}{2}\sin x,$$
we have
$$f(x) =  2-\frac{3}{4}\cos^{2}{x}-\Big(\frac{\sqrt{3}}{2}\sin x\Big)^2=2-\frac{3}{4}\cos^{2}{x}-\frac{3}{4}\sin^{2}{x}=2-\frac{3}{4}=\frac{5}{4}.$$
Therefore, 
$$g(f(x))=g(\frac{5}{4})=\frac{5}{4}+\frac{1}{4}=\frac{3}{2}.$$
