Uniqueness of the uniform pdf It is well known that a uniform distribution over the interval $[a,b] \subset \mathbb R$ has pdf 
$$f_X(x) = \begin{cases} \dfrac{1}{b-a}, & x \in [a,b] \\[5pt] 0, & \text{otherwise}\end{cases}$$
Clearly, under this distribution any two sub-intervals of $[a,b]$ with the same length have the same probability. My question is, modulo sets of measure $0$, is this the unique pdf with this property (that any two sub-intervals of the same length have the same probability)? 
 A: If every two subintervals of the same length have the same probability, then:
Lemma 1: Every interval containing only one point has measure $0$.
Proof: If it had positive measure, then the whole interval $[a,b]$ would have infinite measure. $\blacksquare$
Lemma 2: For $n=1,2,3,\ldots,$ each of the intervals $[k/n,\ (k+1)/n]$ has measure $1/n$.
Proof: $$P\left( \bigcup_{k=0}^{n-1} \left[ \frac k n , \frac{k+1} n  \right] \right) = \sum_{k=0}^{n-1} P\left( \left[ \frac k n , \frac{k+1} n  \right] \right) - \sum P(\text{intersections}), $$
where the second sum is that of the measures of all intersections of two such intervals.  Each such intersection has measure $0$ by Lemma 1. And there are no intersections of three or more, so we can stop there. $\blacksquare$
Next, to show Lemma 3, that each subinterval $[c,d]$ has measure $(d-c)/(b-a)$, proceed by squeezing.  I suspect there's a really efficient way to state the details of the proof but I'll have to ponder what it is.
This determines the entire distribution.
Finally, the densities: For any two such densities, what we have shown so far is that their integrals over the same set are always equal:
$$
\int_A f(x)\,dx = \int_A g(x)\,dx \text{ for every measurable set } A.
$$
Hence
$$
\int_A (f(x)-g(x)) \, dx = 0 \text{ for every measurable set }A. \tag 1
$$
Now let $B = \{x\in[a,b] : f(x) > g(x) \}$ and $C=\{x\in[a,b] : f(x) < g(x)\}.$
Now we only need to show that $P(B)=0$, and by the same argument, $P(C)=0.$
We have
$$
B = \bigcup_{n=1}^\infty \left\{ x\in[a,b] : f(x) - g(x) > \frac 1 n\ \&\ f(x)\not > \frac 1 {n-1} \right\},
$$
where, in the case $n=1$, we construe $f(x)\not > \dfrac 1 {n-1}$ to be vacuous.
If $B$ has positive measure, then one of these sets whose union is taken has positive measure, and then $(1)$ fails to hold when $A$ is that set.
And similarly for $C$.
A: To simplify life, assume $a=0,b=1$. Suppose $g$ is a pdf. with the uniform
property.
In the following, let $0\le x \le y \le 1$ and let $p A$ denote the
probability of the set $A$, and so $pA = \int_A g(t)\,dt$.
We have $p[0,1] = 1$. The uniform property shows that $p(x,y)=p[x,y]=p(x,y]=p[x,y)$, in particular, $p\{x\} = 0$.
Since $[0,1] = [0,{1 \over n}] \cup ({1 \over n}, {2 \over n}] \cup \cdots \cup ({n-1 \over n}, {1 \over n}]$, and each has the same length, we have
$p[0,{1 \over n}]= {1 \over n}$, and so $p[0,{m \over n}]= {m \over n}$ (for $m \le n$). If we pick any $t \in [0,1]$,
and let $q_n \to t$ be a non-decreasing sequence of rationals, then
$p[0,t] \ge q_n$ and so $p[0,t] \ge t$. Repeating with a non-increasing
sequence of rationals $r_n \to t$ we see that $p[0,t] = t$.
Hence $G(x) = p[0,x] = x = \int_0^x g(t) \,dt$, and so $g(x) = G'(x) = 1$ ae. $x \in [0,1]$.
