Almost partition of $[0,1]$ Let $S\subseteq[0,1]^2$ be a measurable set that is symmetric, i.e., $(x,y)\in S$ if and only if $(y,x)\in S$ for all $(x,y)\in[0,1]^2$. Suppose that for almost all $(x,y,z)\in[0,1]^3$, we do not have $(x,y),(y,z)\in S$ and $(x,z)\notin S$. In other words, the ($3$-dimensional Lebesgue) measure of $$\{(x,y,z)\in[0,1]^3:(x,y),(y,z)\in S,\,(x,z)\notin S\}$$ is zero. Prove that there exists a collection $\mathcal{J}$ of disjoint measurable non-null subsets of $[0,1]$ such that for almost all $(x,y)\in[0,1]^2$, we have $(x,y)\in S$ if and only if $x$ and $y$ belong to a same set $J\in\mathcal{J}$.
 A: I seem to have found a proof. I am not entirely satisfied with it, since it is rather complex and difficult, but it should do the job.
Definition. For a point $x\in[0,1]$, let the $x$-section of $S$, denoted $S_x$, be defined as the set $\{y\in[0,1]:(x,y)\in S\}$.
First, note that $S$ being symmetric implies that $S_x=\{y\in[0,1]:(y,x)\in S\}$. Second, observe that $S_x$ is a measurable set for almost all $x\in[0,1]$ (this follows from measurability of $S$ and Fubini's theorem for $\mathbb{R}^2$). In fact, for simplicity we will assume that $S_x$ is measurable for all $x\in[0,1]$, since we can change $S$ on a null set without loss of generality.
Let $\Delta$ denote the symmetric difference operator. Furthermore, let $\lambda$ denote the Lebesgue measure (of appropriate dimension).
Definition. A point $x\in[0,1]$ is typical if for every $\varepsilon>0$, there exists a set $Y_x\subset[0,1]$ of positive measure such that $\lambda(S_x\Delta S_y)<\varepsilon$ for every $y\in Y_x$.
Proposition. Almost all points in $[0,1]$ are typical.
Proof. Let $\mathcal{L}$ be the space of Lebesgue measurable sets within $[0,1]$. We can endow $\mathcal{L}$ with a metric $\mu$ defined as $\mu(A,B)=\lambda(A\Delta B)$. Let $\mathcal{Q}\subset\mathcal{L}$ be the set of finite unions of open intervals with rational coordinates.
It a well known fact that $\mathcal{Q}$ is a countable dense subset of $\mathcal{L}$ (which follows by outer regularity of measurable sets and the observation that open sets are countable unions of disjoint open intervals). 
Let $x\in[0,1]$ be a non-typical point. Then there exists $\varepsilon>0$ for which the set $Y_x=\{y\in[0,1]:\lambda(S_x\Delta S_y)<\varepsilon\}$ has measure zero. Since $\mathcal{Q}$ is dense within $\mathcal{L}$, there exists an element $Q_x\in\mathcal{Q}$ which is $\varepsilon/2$-close to $S_x$. It follows that for any non-typical $x'\notin Y_x$, we have that $S_{x'}$ is not $\varepsilon/2$-close to $Q_x$. Since $\mathcal{Q}$ is countable, we can express the set of all non-typical points as countable union of null sets, which a null set.$\blacksquare$
Proposition. For every typical point $x\in[0,1]$ such that $\lambda(S_x)>0$, we have that $S_x$ equals $S_y$ up to a null set for almost all $y\in S_x$.
Proof. We proceed by contradiction, i.e., assume there exists a set $Y_0\subset S_x$ of positive measure such that for every $y_0\in Y_0$, we have $\lambda(S_{y_0}\Delta S_x)>0$. It follows there exists a real $\varepsilon>0$ and a set $Y\subset Y_0\subset S_x$ of positive measure such that for every $y\in Y$, we have $\lambda(S_y\Delta S_x)>\varepsilon$ (since otherwise $Y_0$ could be expressed as countable union of null sets). We denote $\delta=\lambda(Y)$.
Since $x$ is typical, there exists a set $T_x\subset[0,1]$ with $\lambda(T_x)=\gamma>0$ such that for every $x'\in T_x$ we have $\lambda(S_x\Delta S_{x'})<\min(\varepsilon,\delta)/2$.
For every $x'\in T_x$, there exists $Y_{x'}\subset Y$ with $\lambda(Y_{x'})>\delta/2$ such that $Y_{x'}\subset S_{x'}$ (since $S_{x'}$ is close to $S_x$ and $Y$ is big). For every such $y\in Y_{x'}$, we have that $\lambda(S_{x'}\Delta S_y)>\varepsilon/2$. Now, note that for any $z\in S_{x'}\Delta S_y$ we have that the triple $(x',y,z)$ is bad triple, i.e., $(x',y)\in S$ and exactly one of $(x',z)\in S$ and $(y,z)\in S$.
Finally, we have $\gamma>0$ choices of $x'$, for each $x'$ we have $\delta/2>0$ choices of $y$ and for each $x'$ and $y$ we have $\varepsilon/2>0$ choices of $z$ such that $(x',y,z)$ is bad. This is a contradiction.$\blacksquare$
Proposition. Let $x,x'\in[0,1]$ be typical points such that $\lambda(S_x),\lambda(S_{x'})>0$. If $S_x$ and $S_{x'}$ are not equal up to a null set, then they are disjoint up to a null set, i.e., $\lambda(S_x\cap S_{x'})=0$.
Proof. Suppose that $R=S_x\cap S_{x'})$ has positive measure. Then, by the previous proposition, almost every $y\in R$ satisfies $S_y=S_x$ up to a null set and $S_y=S_{x'}$ up to a null set. This contradicts the assumption that $S_x$ and $S_{x'}$ are not equal up to a null set.$\blacksquare$
We now define the family $$\mathcal{J}^*=\{S_x:x\in[0,1]\text{ is typical},\,\lambda(S_x)>0\},$$
where we identify sets $S_x$ if they are equal up to a null set. Then, by the previous proposition, $\mathcal{J}^*$ is countable, since $\{\lambda(J):J\in\mathcal{J}^*\}$ is a set of positive numbers that sum to at most one. Denote $\mathcal{J}^*=\{J^*_1,J^*_2,\ldots\}$.
Finally, to make the set actually disjoint, we define 
$$\mathcal{J}=\left\{J_i=J^*_i\setminus\bigcup_{j=1}^{i-1}J^*_j\text{ for all }i=1,2,\ldots\right\}.$$
We only lose at most a null set of vertices.
