Let $X$ be a random variable such that $E[X] < \infty$ and $P(X \geq \frac{1}{2}+x)=P(X \leq \frac{1}{2}-x), \forall x \in R$ then find $E(X)$ and median$(X)$.
My attempt:
$\int_{-\infty}^{\frac{1}{2}-x} f(t) dt = \int_{\frac{1}{2}+x}^{+\infty} f(t) dt \\ E[X] = \int_{-\infty}^{+\infty} x f(x) dx $
Now i tried splitting interval into $(-\infty,\frac{1}{2}-x], [\frac{1}{2}-x, \frac{1}{2}+x] , [\frac{1}{2}+x, +\infty)$ and intergrate by parts. But i am not to proceed. Kindly tell me how to proceed

The fact that: $$P\left(X\geq \frac{1}{2}+x\right)=P\left(X\leq \frac{1}{2}-x\right)\text{ for all }x\in\mathbb R$$tells us that:$$X-\frac{1}{2}\stackrel{d}{=}\frac{1}{2}-X$$ so that - if $\mathbb{E}X$ exists - we have: $$\mathbb{E}X-\frac{1}{2}=\mathbb{E}\left(X-\frac{1}{2}\right)=\mathbb{E}\left(\frac{1}{2}-X\right)=\frac{1}{2}-\mathbb{E}X$$ or equivalently: $$\mathbb{E}X=\frac{1}{2}$$
$m$ is a median iff: $$P\left(X\geq m\right)\geq\frac{1}{2}\text{ and }P\left(X\leq m\right)\geq\frac{1}{2}$$ Observe that: $$P\left(X\geq \frac{1}{2}\right)=P\left(X\leq \frac{1}{2}\right)$$ and also: $$P\left(X\geq \frac{1}{2}\right)+P\left(X\leq \frac{1}{2}\right)=1+P\left(X=\frac12\right)\geq1$$ implying that: $$P\left(X\geq \frac{1}{2}\right)\geq\frac{1}{2}\text{ and }P\left(X\leq \frac{1}{2}\right)\geq\frac{1}{2}$$ This proves that $\frac{1}{2}$ is a median.
It is not excluded that there are more medians though.