I try to solve exercise 8.1.1 from Einsielder's book Ergodic Theory. It is: "Let $(X,B_X, μ, T)$ and $(Y,B_Y , ν, S)$ be ergodic Z-actions. Define a $\mathbb{Z}^2$-action on the product $(X×Y, μ×ν)$ by $(m, n)\rightarrow T^m×S^n$. Show that this action is ergodic, but has subgroups whose action is not ergodic.
The last part is clear for me (trivial subgroup), but for the first part I am struggling. I thought of taking a measurable function $f$ on $X\times Y$ which is invariant under the action. As one can write $f$ as a convergent series of characteristic functions of products $B_n\times C_n$ where $B_n \in B_X$ and $C_n \in B_Y$, one can write $f=\sum_{k=0}^\infty a_k g_k(x) h_k(y)$ for some $a_k \in \mathbb{R}$ and measurable real-valued $g_k$ on $X$ and $h_k$ on $Y$. If one then takes into account the invariance under the subgroups generated by $(1,0)$ and $(0,1)$, respectively, one sees that for any $x\in X$ the function $f(x,-)$ is constant a.e. on $Y$ and for any $y\in Y$ the function $f(-,y)$ is constant a.e. on $X$. Can one conclude that $f$ is constant almost everywhere? And if yes, how? Thanks for any hints