When Banach indicatrix is measurable? Let $f:X\to Y$ is a measurable function. Banach indicatrix
$$
N(y,f) = \#\{x\in X \mid f(x) = y\}
$$
is the number of the pre-images of $y$ under $f$. If there are infinitely many pre-images then $N(y,f) = \infty$. 
Let $X\subset\mathbb R^n$, $Y\subset\mathbb R^m$ with Lebesgue measure.
I am interested to know if $N(y,f)$ is a measurable function (?) 


*

*If $X$ is an interval (say $X=[a,b]$) and $f$ is a continuous function, the answer is some how positive (https://math.stackexchange.com/q/68635/23566).

*In Federer's Geometric measure theory we find following theorem 



Let $X$ be a separable metric space and let $f(A)$ be $\mu$-measurable for all Borel subsets $A$ of $X$. 
  Let $\zeta(S) = \mu(f(S))$ for $S\subset X$ and let $\psi$ be the measure on $X$ defined by the Carathéodory construction from $\zeta$. Then
  $$
\psi(A) = \int\limits_{A}N(y,f)\, d\mu_{Y}
$$
  for every Borel set $A\subset X$.

Does it say anything about measurability of $N(y,f)$ ? 
 A: A counterexample.
Let $F : \mathbb R \to \mathbb R$ be the Cantor singular function.  $F$ is continuous.  Let $C \subseteq \mathbb R$ be the middle-thirds Cantor set.  $C$ has Lebesgue measure zero.  $F$ maps $C$ onto $Y = [0,1]$.  Let $M \subseteq [0,1]$ be a non-measurable set.  For simplicity, remove from $M$ any points with two different binary expansions.   Then $X := F^{-1}(M)$ is a subset of $C$, so it is Lebesgue measurable.  Let $f : X \to Y$ be the restriction of $F$.  $f$ is continuous, hence measurable.  Next:
$$
\#\{x \in X : f(x)=y\} = \begin{cases}
0,\qquad y \not\in M
\\
1,\qquad y \in M
\end{cases}
$$
Note there are no points with $2$ or more pre-images, since those would be points with two different binary expansions, and we removed those.  
Since $M$ is a non-measurable set, we have a counterexample.
note
Compare the two bullet-points in the question.
For the first: in this example $X$ is not an interval.
For the second: in this example the property "$A$ Borel (in $X$) implies $f(A)$ measurable" fails.
A: This is an attempt to rid of demand of continuity.
The following proof is essentially an adaptation of Banach's original proof in case of continuous function defined on segment $[a,b]$. See also https://math.stackexchange.com/a/144832/23566.

Lemma Let $f\colon \mathbb R^n \to \mathbb R^m$ be a measurable function and
an image $f(B)$ is measurable for any Borel measurable set $B$.
Then the Banach Indicatrix $N(y,f)$ is measurable.

Proof. We use a dyadic decomposition.
For each integer $k\geq 0$ consider collection of cubes $\{P^k_i\}$ of the form
$$
P^k_i =  (a_1^i\cdot2^{-k},(a_1^i+1)\cdot2^{-k}]\times\cdots\times(a_n^i\cdot2^{-k},(a^i_{n+1})\cdot2^{-k}],
$$
where the $a^i_j$ are all integers.
The properties we need are following: cubes $P^k_i$ are disjoint; $\mathbb R^n = \bigcup\limits_{i=1}^{\infty}P^k_i$; $\operatorname{diam} P^k_i = \sqrt{n}2^{-k}\to 0 $ as $k\to\infty$.
For $y \in \mathbb R^m$ and $i\in \mathbb N$ let
$$
L_{i}^{(k)}(y) = \begin{cases} 1, & \text{if } y \in f(P_{i}^{(k)}), \\ 0, & \text{if } y \not\in f(P_{i}^{(k)}). 
\end{cases}
$$
The functions $L_{i}^{(k)}(y)$ are non-negative and measurable because the set $f(P_{i}^{(k)})$ is measurable.
Therefore the sum
$$
N_k(y) =\sum\limits_{i=1}^{\infty}L_{i}^{(k)}(y)
$$
is also measurable.
Thus, the sequence $(N_k)_{k=1}^\infty$ of measurable functions is increasing and therefore
the pointwise limit
$$
N^*(y) = \lim_{k\to\infty} N_k(y)
$$
exists and is a measurable function of $y$.
Note that $N_k(y)$ simply counts on how many of the cubes $P_{i}^{(k)}$ the function $f$ attains the value $y$ at least once.
Thus $N(y,f) \geq N_k(y)$ for all $k$, so $N(y) \geq N^*(y)$.
Let us argue that $N^*(y) \geq N(y,f)$.
Let $q$ be an integer such that $N(y,f) \geq q$.
Then there exist $q$ different points $x_1,\dots,x_q$ such that $f(x_j) = y$.
If $k$ is so large that points $x_1,\dots,x_q$ are in separated cubes $\{P_{i_j}^{(k)}\}_1^q$
then $N_k(y) \geq q$.
This shows $N^*(y) \geq N(y,f)$ and thus $N^*(y) = N(y,f)$, establishing measurability.

EDIT
After a while I came to the following

Theorem Let $f:X\to Y$ be a $\mu_X$-measurable mapping, and $A\subset X$ be a Borel set.
Then $f$ can be redefined on a set of $\mu_X$-measure zero in such a way that
the Banach indicatrix $N(y,f,A)$ is a $\mu_Y$-measurable function.

Partly this was known though I've wrote a proof here.
A: This is a corollary of Rokhlin's theorem on classification of measurable partitions in Lebesgue spaces from his famous paper "On the fundamental ideas of measure theory". The Russian original is available. The statement you need is (I) at the beginning of p.138. Alas, the way measure theory is still taught nowadays, most mathematical students are nor aware of Rokhlin's theory.
