$\mu$ measurable functions and separable metric spaces I was reading a math textbook and the author gives the following without proof. I have no clue on how to proceed. 
Let $(X, \mathcal{F}, \mu)$ be a measure space and $(Y,d)$ be a separable metric space ($d$ is the metric). If $f:(X,\mathcal{F}) \rightarrow (Y, d)$ is a $\mu$-measurable function prove that there exists an $\mathcal{F}$ measurable function which coincides with $f$ everywhere except on a $\mu$-negligible set.
Any help is greatly appreciated.
EDIT: The textbook is "Functions of Bounded Variation and Free Discontinuity Problems" by Luigi Ambrosio et. al.

Let $(V_n) \in Y$ be a countable base for the separable metric space $Y$. Then define 
$V_n^\prime = V_n \cap V_{n-1}^c \cap V_{n-2}^c... \cap V_1^c$ and $V_1^\prime = V_1$. Clearly, $V_n^\prime$ are all
measurable. Now $f^{-1}(V_n^\prime) = E_n \cup N_n = E_n + (E_n^c \cap N_n) = E_n + N_n^\prime$, where $E_n$ is 
$\mathcal{F}$-measurable and $N_n, N_n^\prime$ are
$\mu$-negligible. As all $V_n^\prime$ are all pairwise disjoint, $f^{-1}(V_n^\prime) = E_n + N_n^\prime$ are all disjoint.
Define a new function $g: X \rightarrow Y$ such that $g(x) = f(x)$ on all $x \in E_n$ and on $x \in (\cup_{i=0}^\infty E_i)^c$ to be any 
value. Then $g$ is $\mathcal{F}$-measurable and is a.e. equal to $f$.
I hope this proof is correct.
