Example of a non-Lipschitz $f \in \mathrm{C}^1(U)$ where $U \subseteq \mathbb{R}^n$ is a non-convex compact connected set

Consider a smooth function of several variables $f: U \to \mathbb{R} \in \mathrm{C}^1(U)$ where $U \subseteq \mathbb{R}^n$ is a connected set. It can be proven using the mean value theorem that if $U$ is compact and convex (any two points of $U$ can be connected by a segment in $U$), then $f$ is Lipschitz, i.e. $$ \exists L \in \mathbb{R} \quad \forall x, y \in U \quad |f(x) - f(y)| \le L \, ||x - y|| .$$ Sketch of a proof goes like this: consider a segment connecting $x$ and $y$, parametrize it, and consider $f$ along the segment as a function of one variable. Apply mean value theorem to it. Since the differential $\mathrm{d}f$ of $f$ is a continuous mapping on a compact $U$, it is bounded by Weierstrass theorem, and the inequality follows. See this stackexchange question for a full proof.

My textbook (on ODEs) says that if $U$ is compact, but not convex, then $f$ can be non-Lipschitz. It also provides an example. In polar coordinates on a plane, consider $$ (r, \phi) \mapsto (r-1)\phi \quad\text{ with } U = \{(r,\phi) \mid 1 \le r \le 2 \;\land\; \phi \in [(r-1)^2, 2\pi - (r-1)^2] \} $$ Question: Please help me see that this function is indeed non-Lipschitz. What is the motivation for such a strange set of values of $\phi$? If you know a simpler example, please share.

UPD: My confusion came from the definition of "f in polar coordinates". It must be understood that $f$ is still a function of usual cartesian coordinates $x,y$, but is expressed in terms of the transition-to-polar-coordinates map $(x, y) \mapsto (r(x,y), \phi(x,y))$ as $f(x,y) = (r(x,y)-1) \phi(x,y)$. The definition of $U$ must be changed accordingly to $$ U = \{(x,y) \mid 1 \le r(x,y) \le 2 \;\land\; \phi(x,y) \in [(r(x,y)-1)^2, 2\pi - (r(x,y)-1)^2]\}.$$


If you do not assume compactness, such an example can be easily found by setting $$ (r, \phi) \mapsto \phi$$ in $U = \{ (r, \theta) : 1<r<2, \phi \in (0,2\pi)\}$. This functions fails to be Lipschitz since around $\phi = 0 = 2\pi$, the functions value is discontinuous.

If you requires compactness, we can no longer use $\phi \in (0,2\pi)$. We cannot use something like $[\delta, 2\pi -\delta]$ either: this would make the function Lipschitz since the distance between $\{ \phi = \delta\}$ and $\{ \phi = 2\pi-\delta\}$ is uniformly bounded from below. So we would like we have $\phi$ in ranges $[\delta_1 (r), 2\pi-\delta_2(r)]$ for some positive functions $\delta_1, \delta_2$ so that $\delta_1(r_0) = \delta_2(r_0) = 0$ for some $r_0$. But then the function $(r, \phi) \mapsto \phi$ also need modifications since it is no longer well defined at $(r_0, 0) = (r_0,2\pi)$.

To remedy these, $f(r, \phi)=(r-1)\phi$ in $U = \{ (r, \phi) : 1\le r\le 2, \phi\in [(r-1)^2, 2\pi -(r-1)^2]\}$ deals with the problem. At least it is well defined (even at $(1, 0) = (1,2\pi)$), and that it is NOT Lipschitz, since

$$ |f(1+\epsilon, \epsilon^2) - f(1+\epsilon, 2\pi -\epsilon^2)|= \epsilon (2\pi-\epsilon^2) = O(\epsilon)$$ But the distance between $(1+\epsilon, \epsilon^2)$, $(1+\epsilon, 2\pi-\epsilon^2)$ is $2( 1+\epsilon) \sin (\epsilon^2) = O(\epsilon^2)$. Thus $f$ cannot be Lipschitz.

(Note that the choice $(r-1)^2$ is not that essential: it suffices to choose $(r-1)^\alpha$ for some $\alpha >1$.