We can solve **M first.
Let 3x+ 1=n+a (n is an integer, 0 ≤ a
f(x)-2x = n+0.5-2(n- 1+a)/3 = 0
So 3n+ 1.5-2n+2-2a=0, that is, n=2a-3.5.
Because 0 ≤ 2a
So-3.5 ≤ n
So n=-3 or -2, corresponding to a=0.25 or 0.75.
So x=- 1.25 or -0.75 and then look at g(x)-2x=0.
-1≤x≤0, g (x) = 2 (-x)-1≥1= 0, x=0, equals sign, 2x≤0.
So g(x)=2x can only be obtained when x=0.
When 0
So only when x= 1 can we get g(x)=2x.
When 1
So g(x)=2x can only be obtained when x=2.
The same is true in 2.
So the solution of g(x) is x=0, 1, 2.
So the sum of all the elements is:
- 1.25-0.75+0+ 1+2= 1