For each fixed e, we can assign a modulus of continuity that is defined for a.e. x and invariant under choice of representative of equivalence class.
Let f = g a.e. Then there exists a set (denoted S_e for use later) of full measure on which f = g. For all x in this set, I claim M(f, e) (x) = M(g, e) (x). Assume for contradiction they differed, that is M(f, e) (x) = a and M(g, e) (x) = b for some distinct a and b. Wlog b < a. Then for every small enough d > 0, there exists a set H(d) of positive measure such that g[H(d)] is not in [g(x) - e, g(x) + e], and further H(d) is in B(b+d, x) Since f = g both a.e. and at x, this implies for every d > 0 there is a set J(d) in B(b+d, x) of positive measure such that f[J(d)] is not in [f(x) - e, f(x) + e]. Taking d < a - b. we get a contradiction, as required.
We can then simultaneously assign a modulus of continuity that is well defined for a.e. x for a dense set of e.
Fix a countable dense set D. Then the set S(D) := Intersect (over e in D) S_e is a countable intersection of sets of full measure, and so is itself of full measure. For all x in S(D) then, we have M(f, e) (x) = M(g, e) (x) for all e in D.
Finally, extending by requiring right continuity and showing that it does not depend on the choice of dense set.
For a countable dense set D and fixed x in S(D), define M(D, f, x) (e): (0, inf) -> [0, inf] to be the unique (can provide an additional proof of this part if needed) right continuous function such that M(D, f, x) (e) agrees with M(f, e) (x) for all e in D. Note that this function is defined for all e, not just almost every e.
Further, for any two countable dense sets C and D, and for all x in the full measure set [S(C) intersect S(D)], I claim we have M(D, f, x) (e) = M(C, f, x) (e) everywhere (i.e., for all e). To see this, note that for all x in S(C) intersect S(D) we must have M(D, f, x) (e) = M(D Union C, f, x) (e) for all e, and similarly for M(C, f, x) and so, on a set of x of full measure, we have M(D, f, x) = M(C, f, x) everywhere as required.
Now fix any dense set D and, once and for all, define M(f) (x, e): R^n x (0, inf) -> [0, inf] by
For all x in S(D), MR(f) (x, e) := M(D, f, x) (e).
This defines M(f) a.e. in the product measure. By the preceding argument, this does not depend on the choice of dense set. And since all the x we used for the initial definition were in S(D), M(f) = M(g) a.e. And so, finally, this defines M as an operator between spaces of equivalence classes of functions, taking the equivalence class f to the equivalence class M(f).
As a final precaution, we note that by right continuity in e and measurability in x, M(f) is indeed measurable.