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.*



Is the set of measurable maps with countable range Borel?
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$.


