I have a sequence of sets $\{ U_r\}_{r\in D}$ in a topological group $G$, where $D$ is the set of dyadic numers in $[0,1]$ such that $U_{1/2^n}$ is a neighborhood of the identity $e \in G$, $U_{1/2^n}^{-1}=U_{1/2^n}$ and $$U_{1/2^{n+1}}U_{1/2^{n+1}} \subseteq U_{1/2^n}$$ for all $n$. Also I have that $$U_{1/2^n}U_{k/2^n} \subseteq U_{(k+1)/2^n}$$ for $1\leq k<2^n.$
I need to show that the function $f:G \to [0,1]$ defined by
$$f(x):= \inf\{r \in D : x \in U_r\}$$
is uniformly continuous. I have show that $f$ is continuous, but I am stuck in showing uniform continuity.
The idea should be that $f$ gives you the "distance from $x$ to $e$", and $U_r$ works as a "ball of radius $r$".
So you should prove that if $yx^{-1}\in U_{1/2^n}$ then $|f(x)-f(y)|\leq 1/2^n$, or equivalently $$f(y)-1/2^n\leq f(x)\leq f(y)+1/2^n.\tag{$*$}$$
For the first inequality of $(*)$, use the definition of $f(x)$ as an infimum and the inclusion $U_{1/2^n}U_{k/2^n}\subseteq U_{(k+1)/2^n}$.
The second inequality of $(*)$ follows with the same argument with the roles of $x$ and $y$ interchanged (and symmetry of $U_{1/2^n}$).
Note that that this is right uniform continuity (for the right uniformity of $G$).