Hierarchical model for uniform random variable I am thinking about the following model:
$$
\theta \sim \mathcal{U}[c- \epsilon, c+\epsilon],\\
x \mid \theta\sim \mathcal{U}[\theta - \epsilon, \theta + \epsilon].
$$
I want to derive the marginal distribution of $x$. Intuitively, when  $\theta$  takes $c-\epsilon%$ then $x \sim \mathcal{U}[c-2\epsilon, c]$ and when $\theta$ takes $c+\epsilon$ then $x \sim \mathcal{U}[c, c + 2\epsilon]$. Since $\theta$ is uniform, $x\sim \mathcal{U}[c-2\epsilon, c + 2\epsilon]$. I want to derive this formally. My attempt is
$$
f(x)=\int_{c-\epsilon}^{c+\epsilon}f(x\mid\theta)f(\theta)d\theta=\int_{c-\epsilon}^{c+\epsilon}\frac{1}{2\epsilon}\frac{1}{2\epsilon}d\theta=\frac{1}{4\epsilon}\int_{c-\epsilon}^{c+\epsilon}d\theta=\frac{1}{4\epsilon}2\epsilon=\frac{1}{2\epsilon}.
$$
But, this is inconsistent with $x\sim \mathcal{U}[c-2\epsilon, c + 2\epsilon]$, which I think is true. What am I missing?

Your argument is intuitively wrong, $x$ can be $c-2\epsilon$ only if $\theta=c-\epsilon$. However, $x$ can be $c$ for infinite number of possible values of $\theta$. So, the middle values in the range $[c-2\epsilon, c+2\epsilon]$ have higher likelihood of appearing while sampling $x$ compared to the corner values. It's not uniform.
The integral calculation has errors as well. For example, for $x=c-2\epsilon$,  the integral limits can't reach $c+\epsilon$ because $f(x=c-2\epsilon|\theta=c+\epsilon)$ is $0$ instead of $1/2\epsilon$. Uniform random variables needs extra care when dealing with their boundaries. The actual uniform PDF is like the following, not just a constant:
$$f(x|\theta)=\frac{1}{2\epsilon}I(\theta-\epsilon\leq x\leq \theta+\epsilon)$$
Integrating with these indicator functions might be tricky. For this particular case, you need to consider intervals of $x$. A good way to visualize is to plot the regions on an x-y plane and integrating/marginalizing there.
