Let $A\subset \mathbb{R}$ and suppose that $f:A\to \mathbb{R}$ has the following property: for each $\epsilon>0$ there exists a function $g_{\epsilon}:A\to \mathbb{R}$ such that $g_{\epsilon}$ is uniformly continuous on $A$ and $|f(x)-g_{\epsilon}(x)|<\epsilon$ for all $x\in A$. Prove that $f$ is uniformly continuous on A.
My attempt: Since $g_{\epsilon}$ is uniformly continuous so for each $\epsilon>0$ $\exists \delta(\epsilon)>0$ such that if $x,u\in A$ are arbitrary numbers then $|g_{\epsilon/2}(x)-f(x)|<\epsilon/2$. Now
$|f(x)-f(u)|=|f(x)-g_{\epsilon/2}(x)+g_{\epsilon/2}(x)-f(u)|\leq |f(x)-g_{\epsilon/2}(x)|+|g_{\epsilon/2}(x)-f(u)|<\epsilon/2+\epsilon/2=\epsilon$. Hence $f(x)$ is uniformly continuous.
Is my solution correct? If not, where is my mistake? Please any suggestion would be helpful. thank you.
Your idea is great. But you can't compare $f(u)$ and $g_{\epsilon/2}(x)$ that easily, so you need to include one more term. Also, you have to use your $\delta$ somehow, and as part of that specify what property you want it to fulfill. At the moment, you've just picked an arbitrary $\delta$ and not used it.
Take a $\delta$ such that for any $x, y$ with $|x-y|<\delta$ we have $|g_{\epsilon/3}(x)-g_{\epsilon/3}(y)|<\frac\epsilon3$. This way we get, for any $x, y$ with $|x, y|<\delta$: $$ |f(x)-f(y)| = |f(x)-g_{\epsilon/3}(x) + g_{\epsilon/3}(x) - g_{\epsilon/3}(u) + g_{\epsilon/3}(u) - f(u)|\\ \leq |f(x)-g_{\epsilon/3}(x)| + |g_{\epsilon/3}(x) - g_{\epsilon/3}(u)| + |g_{\epsilon/3}(u) - f(u)|\\ <3\cdot \frac\epsilon3 $$