Solution (source code)

= Solution

Fix sample points $(x_i,z_i)$, $1\leq i\leq n$. A labeling by $h(x,z)=f(x)g(z)$ is the coordinatewise product of one labeling that $\mathcal F$ realizes on $x_1,\ldots,x_n$ and one that $\mathcal G$ realizes on $z_1,\ldots,z_n$. There are at most the product of the two numbers of choices, so
$$
\boxed{s(\mathcal H,n)\leq s(\mathcal F,n)s(\mathcal G,n)}.
$$