Is the set of measurable maps with countable range Borel? Let $(X,\mu)$ be a standard probability space, and $(Y,\tau)$ an uncountable Polish space. Then the set $L^0(X,\mu,Y)$ of measurable maps from $X$ to $Y$  identified up to measure 0 is Polish w.r.t. the topology of convergence in measure. 
It is then not hard to see that the subset of maps $X\to Y$ with countable range is analytic, 
but is it Borel? 
To see that this set is analytic, note that if $A$ belongs to the measure algebra of $(X,\mu)$, then $f:X\to Y$ is (a.e.) constant on $A$ iff for all $B\subseteq A$, $\frac{\int_A f}{\mu(A)}=\frac{\int_B f}{\mu(B)}$, which is a closed condition on $(f,A)$. Then $f$ has countable range iff there exists a sequence $(A_n)$ of elements of the measure algebra such that $\bigcup_n A_n=X$ and such that the restrictions of $f$ to the $A_n$'s are constant functions.
 A: The set of maps in $L^0(X,\mu,Y)$ with countable range is always Borel, and the way to see it is to correctly reformulate the question: we are looking at the set of elements  $f\in L^0(X,\mu,Y)$ such that the pushforward measure $f_*\mu$ is completely atomic. 
Now, if we let $(A_s)_{s\in \mathbb N^{<\mathbb N}}$ be a Lusin scheme on $Y$ (for the definition of a Lusin scheme see Classical descriptive set theory by Kechris, def. 7.5) , we see that the measure $f_*\mu$ is completely atomic iff as $\epsilon$ tends to $0$, the quantity $$\lim_{n\in\mathbb N}\sum_{|s|=n, \mu(f^{-1}(A_s))\geq \epsilon}\mu(f^{-1}(A_s))$$
converges to one (at each stage $n$ we compute the measure the reunion of the elements of our countable partition $(A_s)_{|s|=n}$ which have measure greater than $\geq\epsilon$, so that at $\epsilon$ fixed the limit we get as $n\to \infty$ is the measure of the set of atoms which have measure $\geq \epsilon$), which is a Borel condition.  Not that the same argument shows that the set of continuous probability measures is Borel (exercise 17.37 of loc.cit.): it is the set of measures for which the above quantity  equals zero for all $\epsilon>0$.
