Your procedure for the first exercise is correct. Note however that, as you may have noticed already, that approach is only useful if the cosine has unitary pulsatance. There is a generic way to do this, if we think of the problem in the frequency domain.
I'll apply this method to the exercise you already solved, so that you can work the second one on your own. In the frequency domain, your exercise can be stated as follows:
$$G(\omega)=\frac{1}{2\pi}X(\omega) *[\pi\delta(\omega-1)+\pi\delta(\omega+1)]$$
Remember that convolving signals with Dirac deltas can be easily made graphically. It's just centering the signal being convolved (in this case, $X(\omega$)) in the position where the impulses are.
Notice that when the impulses are centered in $\omega=\pm1$, if $X(\omega)$ was a rectangular pulse of width $2$ and amplitude $2$ as well, then the convolution would return a rectangular pulse of width $4$ (one for each impulse, and as they don't overlap they keep the rectangular shape) of amplitude $2\pi$. But because convolution in the frequency domain has to be divided by $2\pi$ when going back to the time domain, we get that if $X(\omega)=\mathrm{rect}(\omega/2)$, then the equality holds. That transform corresponds indeed to the signal $x(t)$ you found using the trigonometric identity.
See that this approach is useful for any position of the Dirac deltas. In the second case, they are at $\omega=\pm 2/3$. Can you solve it now?