Let $f : [0,1]^d \to [0,1]$ be a "nice" function and consider the uniform distribution on (i.e., Lebesgue measure on $\mathbb R^{d+1}$ restricted to) the set $$\mathcal X = \{(x,y): x \in [0,1]^d,\; y \in[0, f(x)]\}.$$ Let us construct a subset $\mathcal X_1$ of $\mathcal X$ by picking at most $n$ $y$-points for any given $x$. That is, $|\{ y: (x,y) \in \mathcal X_1\}| \le n$ for all $x \in [0,1]^d$. Can we use Fubini theorem to conclude that $\mathcal{X}_1$ has measure zero? Intuitively, this should be true, on the other hand $\mathcal X_1$ is an uncountable union of finite sets and potentially uncountable which makes the conclusion a bit uncomfortable.
EDIT: I guess part of the problem might be even the measurability of such set. For concreteness, for every $x$ the $y$-points chosen are zeros of a polynomial of degree $n$ whose coefficients are given by "nice" fixed functions of $x$.
EDIT: In anticipation of a counter-example, what is a general regularity condition for this selection process to make the resulting set a measurable set with measure zero.