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?