Composition of uniform function and continuous function The following is given:
$$g: \mathbb{R}\to\mathbb{R}\colon\quad x \mapsto f\left(\frac{1}{1+x^2}\right),$$
with $f:\mathbb{R}^+\to\mathbb{R}$ continuous.

Is $g$ uniform continous?

I answered there yes and I thought I could prove it by dividing the problem by looking in an interval and by looking outside that interval where the interval is big enough so $g(x)$ goes to $f(0)$. Then using the triangular inequality I proved the problem. However, the next question is: is $h\colon\mathbb{R}\to\mathbb{R}: x \mapsto g(x)^2$ also uniform continuous?
My gut feeling says no but also yes because I can use the same method, but I can not proof this or give a counter example.
 A: We need $f$ defined and continuous at $x = 0$ for $g$ to be uniformly continuous.  For example, if $f:\mathbb{R}^+ = (0,\infty) \to \mathbb{R}$ with $f(x) = 1/x$, then $f$ is continuous on its domain, but $g(x) = 1 + x^2$ is not uniformly continuous on $\mathbb{R}$.
The same applies to $h = g^2$.

Otherwise, if $f$ is continuous on $[0,\infty)$ then both $g$ and $h=g^2$ are uniformly continuous on $\mathbb{R}$. The proofs are similar and one for $h$ follows.
Since $\lim_{x \to \pm \infty}h(x) = f^2(0)$, there exists $X>0$ such that $|h(x) - f^2(0)| < \epsilon/3$ for all $x \in [X, \infty]$ and $x \in (-\infty,-X]$.
Since $h$ is continuous  on the compact set $[-X,X|$, it is uniformly continuous there and there exists $\delta > 0$ such that $|h(x) - h(y)| < \epsilon/3$ for $x,y \in [-X,X]$ when $|x-y| < \delta$.
Now we can show that for all $x, y \in \mathbb{R}$ such that $x - y| < \delta$, we have $|h(x) - h(y)| < \epsilon$.   There are a few cases to consider. For example if $x \in [-X,X]$, $y \in [X,\infty)$ and $|x-y| < \delta$, then
$$|h(x) - h(y)| \leqslant |h(x) - h(X)| + |h(X) - f^2(0)| + |f^2(0) - h(y)| < \frac{\epsilon}{3} + \frac{\epsilon}{3}+ \frac{\epsilon}{3} = \epsilon$$
