Haar measure, can image of modular function be any subgroup of $(0,\infty)$? It is easy to find examples of locally compact second countable Hausdorff topological groups $G$ whose modular function $\Delta$ has image $\{1\}$ or $(0,\infty)$. Are there groups $G$ of this kind for which the image of $\Delta$ is anything else?
 A: Fix a prime $p$, and consider the group $G$ of affine automorphisms of $\mathbb{Q}_p$.  That is, take $G=(\mathbb{Q}_p\setminus\{0\})\times\mathbb{Q}_p$ and make it a group by identifying $(a,b)\in G$ with the map $x\mapsto ax+b$ from $\mathbb{Q}_p$ to itself.  Writing $\mu$ for the usual additive Haar measure on $\mathbb{Q}_p^2$, we can identify the Haar measures on $G$ as follows.  Note that left translation by $(a,b)$ sends $(c,d)$ to $(ac,ad+b)$ and this map multiplies $\mu$-measures of sets $|a|_p^2$ (since multiplication by $a$ on $\mathbb{Q}_p$ multiplies measures by $|a|_p$, and we are multiplying both coordinates by $a$).  It follows that the measure $\mu/|a|_p^2$ is left-invariant on $G$, and so is a left Haar measure.  On the other hand, right translation by $(a,b)$ sends $(c,d)$ to $(ac,bc+d)$ which multiplies $\mu$-measures only by $|a|_p$, so $\mu/|a|_p$ is a right Haar measure.
It follows that the modular function of $G$ is $\Delta(a,b)=1/|a|_p$.  In particular, the image of $\Delta$ is $\{p^n:n\in\mathbb{Z}\}$.
