Formal problem statement:
Given $X \sim \mathcal{U}(0, a)$, prove that if $Y\equiv X \pmod b$, then $Y \sim \mathcal{U}(0, b)$ if and only if $a \equiv 0 \pmod b$ and $a \ge b$.
My solution
The basic idea here is that the integral over the range should be 1. My intuition tells me the following:
$a \le \alpha b + \beta$ where $\alpha=\lfloor \frac{b}{a} \rfloor$, $\beta\equiv a \pmod b$ then, range $(\beta, b)$ will have the same density, as density of $X$ is "repeated" $\alpha$ times. $\beta \equiv X \pmod b$, so range $(0, \beta)$ will be have twice the density of any other range. As a result, if $\beta \ne 0$, the modulo will yield non-uniform distribution.
Question
Am I correct? Is there more elegant proof to this?
Let $\left\lfloor\dfrac ab\right\rfloor=n$. You can partition the range $[0,a)$ in $n$ intervals of size $b$ and a remaining one of size $a\bmod b$. They will map uniformly to $[0,b)$ and $[0,a\bmod b)$ respectively, resulting in a piecewise constant distribution proportional to $n+1$ in $[0,a\bmod b)$ and to $n$ in $[a\bmod b,b)$.