The function $f:M\subset \mathbb{R}^n\to Y$ with values in Banach space is called measurable iff the following hold
1) The domain is measurable
2) There exists a sequence $(f_j)$ of step functions $f_j :M\to Y$ such that $$\lim_{j\to\infty}f_j(x)=f(x)$$ for almost every $x\in X$.
Proposition $\,$ $f$ is measurable if the following hold:
1) $M$ is measurable and $Y$ is separable Banach space
2) $f$ is continuous almost everywhere
What is the proof of that fact? One should construct a sequance of step functions. To do so, separability would be useful I guess. If $Y$ is separable we may take the values needed for step functions from the dense and countable subset of $Y$. How to define $M_i$? The very first idea that came to my mind is: if $a_i$ is a value from dense and contable subset of $Y$, why not to set $M_i=f^{-1}(a_i)$?