Let $f$ be the pdf and let $J(c) = E(|X-c|)$. We want to maximize $J(c)$. Note that $E(|X-c|) = \int_{\mathbb{R}} |x-c| f(x) dx = \int_{-\infty}^{c} (c-x) f(x) dx + \int_c^{\infty} (x-c) f(x) dx.$
To find the maximum, set $\frac{dJ}{dc} = 0$. Hence, we get that, $\begin{align} \frac{dJ}{dc} & = (c-x)f(x) | _{x=c} + \int_{-\infty}^{c} f(x) dx + (x-c)f(x) | _{x=c} - \int_c^{\infty} f(x) dx\\ & = \int_{-\infty}^{c} f(x) dx - \int_c^{\infty} f(x) dx = 0 \end{align} $
Hence, we get that $c$ is such that $\int_{-\infty}^{c} f(x) dx = \int_c^{\infty} f(x) dx$ i.e. $P(X \leq c) = P(X > c).$
However, we also know that $P(X \leq c) + P(X > c) = 1$. Hence, we get that $P(X \leq c) = P(X > c) = \frac12.$
EDIT
When $X$ doesn't have a density, all you need to do is to make use of integration by parts. We get that $\displaystyle \int_{-\infty}^{c} (c-x) dP(x) = \lim_{y \rightarrow -\infty} (c-y) P(y) + \displaystyle \int_{c}^{\infty} P(x) dx.$ Similarly, we also get that $\displaystyle \int_{c}^{\infty} (x-c) dP(x) = \lim_{y \rightarrow \infty} (y-c) P(y) - \displaystyle \int_{c}^{\infty} P(x) dx.$