Let $X$ be a metric space, $A$ and $B$ are two subsets of $X$. $d(x, A) = \inf_{z \in A}d(x,z)$ and $\inf_{x \in A,y \in B}d(x,y) = \delta > 0$ We define $$f(x) = \frac{d(x,A)}{d(x,A)+d(x,B)}$$
How to show $f(x)$ is uniform continuous? I know that, since $|d(x,A)-d(y,A)| \leq d(x,y)$, $d(x,A)$ is uniform continuous. Is there some principle that guarentee that uniform continuity is preserved by composition of functions?
You have $$|f(x)-f(y)|= \frac{ |d(x,A)d(y,B)-d(y,A)d(x,B)|}{(d(x,A)+d(x,B))(d(y,A)+d(y,B))}$$
Eventually, permute $x$ and $y$ so that: $$|f(x)-f(y)|= \frac{ d(x,A)d(y,B)-d(y,A)d(x,B)}{(d(x,A)+d(x,B))(d(y,A)+d(y,B))}$$
But $d(x,A) \leq d(x,y)+d(y,A)$ so $$ \begin{array}{ll} d(x,A)d(y,B)-d(y,A)d(x,B) & \leq d(x,y)d(y,B)+d(y,A)(d(y,B)-d(x,B)) \\ & \leq d(x,y)(d(y,A)+d(y,B)) \end{array}$$
Finally, $$|f(x)-f(y)| \leq \frac{d(x,y)}{d(x,A)+d(x,B)} \leq \frac{d(x,y)}{d(A,B)} =\frac{1}{\delta}d(x,y)$$
Therefore, $f$ is $1/\delta$-lipschitz and a fortiori uniformly continuous.