Decomposition of a dynamical system into ergodic componenents 
Quick version of the question. Let $(X, \mu)$ be a probability measure space and let $Z$, the group of integers, act on $X$ in a  measure preserving way. How can I decompose $X$ into ergodic componenets? More precisely, can $X$ be equivariantly decomposed into a countable union of subspaces $U_i$, each of which is isomorphic to a product $A_i\times B_i$, such that action on $U_i$ is a product of an ergodic action on $A_i$ and the trivial action on $B_i$?

One can ask the same question also for groups other than integers.

My motivation
I'm currently learning basics of ergodic theory. More precisely, I'm interested in the notion of cost. Let me recall it for group actions: Let a countable discrete group $G$ act on a probability measure space $(X,\mu)$ in a free and probability measure preserving (pmp) manner. Call the action $\rho$. Let $\mathcal R(\rho)$ be the equivalence realtion on $X$ given by $\rho$ (i.e. two points of $X$ are equivalent iff there's a group element which sends one point to the other). Let $F=(U_i,g_i)_{i=1}^\infty$ be a countable family of pairs, where each $U_i$ is a measurable set, and each $g_i$ is an element of $G$. Let $\mathcal R(F)$ be the equivalence relation on $X$ generated by the relation $x \sim y$ iff for some $i$ we have $x\in U_i$ and $\rho(g_i)(x)=y$. Define
$$
cost(F) = \sum \mu(U_i),
$$
and let cost of the action $\rho$ be the infimum of numbers $cost(F)$ over all  families $F$ such that $\mathcal R(F) = \mathcal R(\rho)$, perhaps after restricting both relations to subsets of measure $1$.

Theorem. Let $\rho$ be a free pmp action of $\mathbb Z \times H$, where $H$ is any countable group. Then $cost(\rho)=1$

Suppose first that restriction of the action $\rho$ to $\mathbb Z$ is ergodic. Fix $\varepsilon$. Then for the family $F$ choose pairs $(X, t), (A_1, h_1), (A_2,h_2) \ldots $, where $t$ is a generator of $\mathbb Z$, $h_i$ is an enumeration of elements of $H$, and $A_i$ is any set such that $\mu(A_i)= \frac{\varepsilon}{2^i}$.
Clearly $cost(F) \le  1 + \varepsilon$, so it's enough to see that $\mathcal R(F) = \mathcal R(\rho)$. Take a point $x$ of $X$ and fix $h_i\in H$. We're gonna show that, with probability $1$, $x$ is in relation with $\rho(h_i)(x)$. By the ergodic theorem, since we assume action of $\mathbb Z$ is ergodic, with probability $1$ for some $j$ we have $\rho(t^j)(x)\in A_i$, so we have $x \sim \rho(t^j)(x) \sim \rho(h_it^j)(x) \sim \rho(h_i)(x)$.
When I heard the argument it wasn't even mentioned that we assume that restricion to $\mathbb Z$ is ergodic. Intuitively it's clear what to do - choose $A_i$ more cleverly, "perpendicular to ergodic components of $\mathbb Z$".

Question.  Which theorem from ergodic theory allows to make this choice of $A_i$ "perpendicular to ergodic components" precise?

 A: Answer to the quick version. Yes it is true as soon as $(X,\mu)$ is a Lebesgue space. Beware that the transformation on the product $A_i\times B_i$ is not necessarily a true product, but instead it is a skew-product of the form $(x,y)\mapsto (T_x(y),y)$. This follows from the ergodic decomposition theorem, together with the classification of measurable partitions. 
Recall that if T is an invertible measurable transformation acting on a Lebesgue space X, then there is a measurable partition $C_i$ (which may have uncountably many elements) and
probability measures $\mu_i$ on $C_i$ such that all $C_i$ are invariant by T, T is ergodic w.r.t $\mu_i$ and $\mu$ is obtained by integrating the $\mu_i$.
$$\mu(A) = \int_X \mu_i(A) d\mu$$
There are two kinds of ergodic components $C_i$. The one of positive measure, there are at most countably many such components. Let us remove these components from $X$, together with the periodic points, which are easily dealt with. Rohlin structure theorem on measurable partitions (1947) now says that
there is a isomorphism between $([0,1]\times [0,1], \lambda)$ and $(X,\mu)$ such that the pullback of the measurable partition $(C_i)$ is the decomposition into horizontal lines $([0,1]\times \{i\})_{i\in [0,1]}$. A reference is the book of Parry, "entropy generators in ergodic theory".
Here is how the ergodic decomposition is often used. If it happens that a result is true for an ergodic transform, then it is true for an arbitrary transform in restriction to its ergodic components, and you (may) recover the result on the whole space $X$ just by using the integral formula given above.
A reference for the ergodic decomposition for countable groups action is Glasner, "ergodic theory via joinings" th. 3.22.
Finally the result you are alluding in your last question is a section theorem. Given a measure preserving transform between two Lebesgue spaces X and Y, there is a section from Y to X, up to null sets, and some warning is in order here because this is not true in the Borel category. I think this is again due to Rohlin, and it can be deduced from its structure theorem for measurable partitions. Have a look at the book of Parry, but really this is overkill.
EDIT: following the comments of R.W., here is a counterexample to having a true product, instead of just a skew-product. On $[0,1]\times [0,1]$ take
$(x,y)\mapsto (x+y\ \ mod\ \ 1,y)$, together with Lebesgue measure. The restrictions to the fibers $[0,1]\times \{y\}$ are ergodic for a.e. y, and give uncountably many different isomorphic systems, as can be shown by looking at their spectra. 
A: Alas, there is a lot of confusion both in the answer (which is really misleading) and in the question (since the answer was accepted).
First, about the original question of the author. If this is what he really meant, then the ergodic components of an action satisfying the condition described in the question are $A_i\times b$ with $b\in B_i$, so that among all the ergodic components there are only countable many non-isomorphic ones (as measure preserving actions of $\mathbb Z$, not just as measure spaces!). Now, there are uncountably many non-isomorphic actions (for instance, Bernoulli shifts with different entropies), which can be easily put together as ergodic components of a single non-ergodic action not satisfying the condition from the question, so that the answer to the "quick question" is NO. 
Concerning the reference in the answer to Rohlin's theorem (which is, by the way, very far from being "almost forgotten" - it was and is a basic ergodic theory tool) on classification of measurable partitions, it, indeed, says that "up to removing the atomic part" such a partition is isomorphic to the partition of the square endowed with the Lebesgue measure into vertical segments. However, "removing the atomic part" means not only that the ergodic components must be of measure 0, but also that the conditional measures on the partition elements must be purely non-atomic. In the measure preserving case the ergodic components with the latter property are just orbits of periodic points, but if the measure is quasi-invariant it is not necessarily so. In fact, for a free action atomic ergodic components correspond precisely to the dissipative part of the action (which is empty in the measure preserving case by the Poincare recurrence theorem), whereas non-atomic ones correspond to the conservative part.
Now, returning to the motivation of the question. It is true that when working with actions and equivalence relations from measure-theoretical point of view, one routinely imposes the ergodicity assumption (often without stating it explicitly) in virtue of the ergodic decomposition. However, you don't really need ergodicity for the quoted argument, because what is actually used there is recurrence of the action (which follows in this case from the Poincare theorem), not ergodicity. 
Finally, as the ultimate reference for the ergodic decomposition I would recommend the article Ergodic decomposition of quasi-invariant probability measures by Greschonig and Schmidt.
A: This is the answer Damien Gaboriau told me to the question from "my motivation" section. We can assume that the measure space is the interval $X=[0,1]$. Suppose we have a measured equivalence relation on $X$ whose equivalence classes are infinite countable. We want to show there exists a meaurable subset of $X$ of arbitrary small measure which intersects almost all equivalence classes. 
Note that the map $x\mapsto I(x)=$ "infimum of the class of $x$" is measurable, so for almost all points $x$ the point $I(x)$ is not in the class of $x$, because otherwise we would have a measurable selector which is impossible. So assume for simplicity that $I(x)$ is never in the class of $x$. Then consider the family of sets $B_\epsilon$ for $\epsilon\in \mathbb R_+$. $B_\epsilon$ is the union 
$$
 \bigcup_{x\in X} B(I(x), \epsilon)\cap E(x),
$$
where $B(a,b)$ is the ball with center $a$ and radius $b$, and $E(x)$ is the equivalence class of $x$. The sets $B_\epsilon$ are a descending family with trivial intersection, so they have arbitrary small measures, but each of them intersects all classes.
