First, let's define the model

$Z \sim \text{Bernoulli}(0.5)$ 

$X_1 \sim \text{Uniform}(0, \alpha)$ 

$X_2 | Z = 1, X_1=x_1 \sim \text{Uniform}(0, \alpha)$

$X_2 | Z = 0, X_1=x_1 \sim \delta_{x_1}$ 

$\delta_{x_1}$ is the [Dirac measure][1] or [Dirac delta (density) function][2] (point mass) at $x_1$; you can think of it as a $\text{Normal}(x_1, \sigma^2)$ distribution as $\sigma^2\to 0$.


Next we plug everything into Bayes formula

$P(Z | X_1, X_2) \propto P(Z)P(X_1 | Z)P(X_2 | Z, X_1)$

If $X_1=X_2$, then 

$P(Z=1 | X_1=x_1, X_2 = x_1) \propto 0.5 (\alpha^{-1})\alpha^{-1} $

$P(Z=0 | X_1=x_1, X_2 = x_1) = \infty $, thus the posterior is a $\text{Bernoulli}(0.0)$.

Otherwise


$P(Z=1 | X_1=x_1, X_2 = x_2) \propto 0.5(\alpha^{-1})\alpha^{-1}$

$P(Z=0 | X_1=x_1, X_2 = x_2) \propto 0.5(\alpha^{-1})0 = 0$ implying the posterior is a $\text{Bernoulli}(1.0)$.


  [1]: https://en.wikipedia.org/wiki/Dirac_measure
  [2]: https://en.wikipedia.org/wiki/Dirac_delta_function