How do I test that some function is invariant with respect to say $SU(3)\times SU(2)\times U(1)$? My understanding of group invariance is:
$$
F(G x) = F(x)
$$
For instance, the function $F(x)=\overline{x}x$ is invariant with respect to U(1):
$$
F(e^{-i a} x) = \overline{ e^{-i a} x} e^{-i a} x = F(x)
$$
If I want to prove invariance with respect to a composition of multiple groups such as $SU(2)\times U(1)$, does it suffice to test each group individually? For instance:
Lemma 1
$$
F(e^{-i a} x) = \overline{ e^{-i a} x} e^{-i a} x = F(x)
$$
Lemma 2
$$
F(e^{-i (x \sigma_x + y\sigma_y + z\sigma_z +a I)} x) = \overline{e^{-i (x \sigma_x + y\sigma_y + z\sigma_z +a I)} x}e^{-i( x \sigma_x + y\sigma_y + z\sigma_z +a I)} x = F(x)
$$
Can I conclude that from Lemma 1 and Lemma 2, F(x) is invariant with respect to $SU(2)\times U(1)$?
Also, does the $\times$ means the cartesian product?
 A: Any element of $G\times H$ can be written as product $(g,h) = (g,e_H)(e_G,h)$, where $e_X$ is the neutral element of the group $X$.
Therefore if you define the action of $G$ as the action of $G\times \{e_H\}$ and the action of $H$ as the action of $\{e_G\}\times H$ (thus allowing to identify $g$ with $(g,e_H)$ and $h$ with $(e_G,h)$), then verifying the invariance under $G$ and $H$ individually proves the invariance under $G\times H$:
\begin{align}
F((g,h)x) &= F(g(hx)) && \text{(using the identification above)}\\
&= F(hx) && \text{invariance under $G$}\\
&= F(x) && \text{invariance under $H$}
\end{align}
Note however that it is crucial that you define the actions of the groups as above. Otherwise you could “prove” invariance under $U(1)\times U(1)$ by simply proving invariance under one copy of $U(1)$.
Here $\times$ denotes the direct product of groups which has as underlying set the Cartesian product of the underlying sets of $G$ and $H$, and as group operation the component-wise operation.

As requested in the comments, an example of a function that is invariant under $U(1)$ but not under $U(1)\times U(1)$:
Take the action of $U(1)\times U(1)$ on $\mathbb C^2$ to be
$$(\mathrm e^{\mathrm i\varphi},\mathrm e^{\mathrm i\vartheta})\cdot(a,b) = (a\mathrm e^{\mathrm i(\varphi+\vartheta)},b\mathrm e^{\mathrm i(\varphi-\vartheta)})$$
Now consider the function $F(a,b) = \overline a b$. This function is clearly $U(1)$ invariant under the action $\mathrm e^{\mathrm i\varphi}(a,b) = (ae^{\mathrm i\varphi},be^{\mathrm i\varphi})$.
However it is not invariant under $U(1)\times U(1)$, since
$$F((\mathrm e^{\mathrm i\varphi},\mathrm e^{\mathrm i\vartheta})\cdot(a,b)) = F(a\mathrm e^{\mathrm i(\varphi+\vartheta)},b\mathrm e^{\mathrm i(\varphi-\vartheta)}) = \overline{a\mathrm e^{\mathrm i(\varphi+\vartheta)}}b\mathrm e^{\mathrm i(\varphi-\vartheta)} = \overline ab\mathrm e^{-2\mathrm i\vartheta}$$
