Relation between the measures of two sets defined via Lebesgue integration I posted this question on StackExchange, people have upvoted it but I have not received any response. I read up here that it is okay to post unanswered StackExchange questions on Mathoverflow. So, posting it below.
Suppose $a : \mathbb R_+ \to \{-1,1\}$ is a measurable function. Let $X_0 =\frac12$. Consider a particle that moves on the $X-$axis as follows. 
$$X_t = X_0 + \int_0^t a_s ds$$
where the integral is a Lebesgue integral. 
Fix a $T=\frac12$. So, $X_t \in [0,1]$ for all $t \le T$. 
Let $S \subset [0,1]$ be a set such that $\ell(S) =1$, where $\ell(\cdot)$ is the Lebesgue measure.
Define, 
$$G:= \{t \le T: X_t \in S\}.$$
Is it the case that $\ell(G) = \ell([0,T]) = \frac12$?
That is, the particle spends almost no time outside $S$?
 A: Yes, by the coarea formula. In fact it is sufficient to assume that $a(t)$ is bounded and non-zero almost everywhere.
The function $X(t)$ is Lipschitz continuous (with Lipschitz constant 1), $g(t) = \mathbb{1}_{[0,T] \setminus G}(t)$ is integrable (in fact, bounded by $0$ and $1$), the zero-dimensional Hausdorff measure is just the counting measure, and thus
$$ \begin{aligned} \int_0^T \mathbb{1}_{[0,T] \setminus G}(t) |X'(t)| dt & = \int_0^T g(t) |X'(t)| dt \\ & = \int_0^1 \biggl(\sum_{t \in [0, T] : X(t) = x} g(t)\biggr) dx \\ & = \int_0^1 \# \{t \in [0, T] : X(t) = x, t \notin G\} dx \\ & = \int_0^1 \# \{t \in [0, T] : X(t) = x, X(t) \notin S\} dx \\ & = \int_0^1 \# \{t \in [0, T] : X(t) = x, x \notin S\} dx \\ & = \int_{[0, 1] \setminus S} \# \{t \in [0, T] : X(t) = x\} dx = 0 .\end{aligned} $$
The interand $\mathbb{1}_{[0,T] \setminus G}(t) |X'(t)|$ is non-negative, and hence it is equal to zero almost everywhere. However, $X'(t) = a(t) \ne 0$ almost everywhere, and hence $[0,T] \setminus G$ is necessarily a null set.
