The definition of uniform continuity (if it’s done right) can be phrased as: is uniformly continuous if there exists a function , with , such that for every set . Indeed, when is a two-point set this is the same as , the modulus of continuity. Allowing general sets does not change anything, since the diameter is determined by two-point subsets.
Does it make a difference if we ask for only for connected sets ? For functions defined on the real line, or on an interval of the line, there is no difference: we can just consider the intervals and obtain
However, the situation does change for maps defined on a non-convex domain. Consider the principal branch of square root, , defined on the slit plane .
This function is continuous on but not uniformly continuous, since as . Yet, it satisfies for connected subsets , where one can take . I won’t do the estimates; let’s just note that although the points are close to each other, any connected subset of containing both of them has diameter greater than 1.
In a way, this is still uniform continuity, just with respect to a different metric. Given a metric space , one can define inner diameter metric on by letting be the infimum of diameters of connected sets that contain both and . This is indeed a metric if the space is reasonable enough (i.e., any two points are contained in some bounded connected set). On a convex subset of , the inner diameter metric coincides with the Euclidean metric .
One might think that the equality should imply that the domain is convex, but this is not so. Indeed, consider the union of three quadrants on a plane, say . Any two points of can be connected by going up from whichever is lower, and then moving horizontally. The diameter of a right triangle is equal to its hypotenuse, which is the Euclidean distance between the points we started with.
Inner diameter metric comes up (often implicitly) in complex analysis. By the Riemann mapping theorem, every simply connected domain , other than itself, admits a conformal map onto the unit disk . This map need not be uniformly continuous in the Euclidean metric (the slit plane is one example), but it is uniformly continuous with respect to the inner diameter metric on .
Furthermore, by normalizing the situation in a natural way (say, and ), one can obtain a uniform modulus of continuity for all conformal maps onto the unit disk, whatever the domain is. This uniform modulus of continuity can be taken of the form for some universal constant . Informally speaking, this means that a slit domain is the worst that can happen to the continuity of a conformal map. This fact isn’t often mentioned in complex analysis books. A proof can be found in the book Conformally Invariant Processes in the Plane by Gregory Lawler, Proposition 3.85. A more elementary proof, with a rougher estimate for the modulus of continuity, is on page 15 of lecture notes by Mario Bonk.