Let $\mathbb{Z}_q$ be the additive group of integers modulo $q$ and $U(q):=\{g\in\mathbb{Z}_q:(g,q)=1\}$. If $a\in\mathbb{Z}_q$, then what is the cardinality of the set $\{g\in U(q):ga\equiv a(\mod q)\}$.
Is there a way to count the same? Thank you. Here I am considering the group $U(q)$ (with multiplication modulo $q$) acting on $\mathbb{Z}_q$
The argument Gerry mentions is the way to go. The problem is equivalent to computing the size of the kernel of the modulo map $U(n)\to U(d)$ when $d\mid n$. It's enough to prove this map is onto, since then the kernel's size is $\varphi(n)/\varphi(d)$. Observe the following diagram commutes:
$$\begin{array}{ccc} U(n) & \xrightarrow{\sim} & \bigoplus U(p^r) \\ \downarrow & & \downarrow \\ U(d) & \xrightarrow{\sim} & \bigoplus U(p^s) \end{array} $$
We've prime factorized $n=\prod p^r$ and $d=\prod p^s$ and used the fact that $U(ab)\cong U(a)\times U(b)$ when we know $a,b$ are coprime. Why does this diagram commute? Because to know an integer's residue mod $p^s$ it's enough to know its residue mod $p^r$. Then we simply note the local modulo maps $U(p^r)\to U(p^s)$ are onto; the integer representatives in each both have the same description: integers not divisible by $p$.