Suppose that an observation $x \in (-1,1)$ comes from a sample model with a parameter $\theta$, with density function:
$$ f(x\mid\theta) = \begin{cases} \theta\ if -1 < x < 0\\ 1 - \theta\ if\ 0 \leqslant x < 1 \end{cases}\ $$
a) Suppose that the prior distribution for $\theta$ is uniform over the interval $(0,1)$. Find a Bayes estimator associated with this priori distribution, under the quadratic loss function.
I think for this question, we need to find $E(\theta\mid x)$; here is what I got:
$$ f(\theta\mid x) = \begin{cases} \theta\ if -1 < x < 0\\ 1 - \theta\ if\ 0 \leqslant x < 1 \end{cases}\ $$ since the prior distribution is $\pi (\theta) = 1$. But I'm unsure how to continue.