condition on $\epsilon$ to make $f$ injective 
from the condition $g$ is uniformly continuous, $x$ is also U.continuous and one-one, but we dont know about $g$ is one-one or not, so $\epsilon=0$ will work?may be I am vague. Thank you.

We have
$$
f'(x)=1+\varepsilon g'(x) \quad \forall\ x \in \mathbb{R}.
$$
For $\varepsilon \ge 0$ we have
$$
1-\varepsilon M \le f'(x)\le 1+\varepsilon M \quad \forall\ x \in \mathbb{R}.
$$
If we choose 
$$
\varepsilon \in [0,1/M),
$$
then $f'>0$, i.e. $f$ is strictly increasing and therefore one-to-one.
For $\varepsilon < 0$ we have
$$
1+\varepsilon M \le f'(x)\le 1-\varepsilon M \quad \forall\ x \in \mathbb{R}.
$$
If we choose
$$
\varepsilon \in (-1/M,0),
$$
then $f'<0$, i.e. $f$ is strictly decreasing and therefore one-to-one.
Hence, if $|\varepsilon|<1/M$ then $f$ is injective.
