Let a probability density function of a random variable $X$ be given by
$$ f(x)=\begin{cases} x^3 & \text {if } -1 \le x \le 1 \\ \\ 0 & \text{otherwise} \end{cases} $$
and I need to find the probability $P(-0.5 \le x \le 0.5)$.
So, I simply applied the integration for $f(x)$ with lower limit $= -0.5$ and upper limit $= 0.5$.
Since, $f(x)$ is an odd function (it is symmetric about the origin), the integration gives the value $0.$ However, the probability of course can't be 0 here. So, do I need to take absolute value of the integration for negative values of $x$ in special case of odd functions like this? Or am I missing something, because I never had to take care of any special cases like this while calculating probability of continuous functions until now!
Your function $f$ cannot be probability density function (pdf): pdfs are always non-negative and integrate to $1$, i.e $\int_{\Bbb R} f(x) \; dx = 1$. Your funtion $f$ satisfies neither of these conditions.