$\left(\int_{K^c} X d \mu \right) \left(\int_{K} X d \mu \right) \le \frac{\mu(\Omega)}{4}\int_{\Omega} X^2 d \mu $ Playing around with an exercise I found this inequality:

Given $(\Omega,\mu)$ a measure space, $K$ a measurable subset and $X$ a real random variable, it holds:
$\left(\int_{K^c} X d \mu \right) \left(\int_{K} X d \mu \right)  \le \frac{\mu(\Omega)}{4}\int_{\Omega} X^2 d \mu $

, where $K^c$ is the complementary of $K$.
I wanted to propose this inequality for these reasons:
1- To check if it is true and I did not make any mistake
2- To propose it as a simple exercise
3- To know if it is a well known inequality
Note that one can easily specialize the inequality to a discrete setting.
 A: Let $(\Omega,\mathfrak{A},\mu)$ be a measure space, $K\subseteq\Omega$ be measurable and $X\colon\Omega\rightarrow\mathbb{R}$ be measurable. Furthermore, assume that $X$ is non-negative or integrable. Note that $\int_KX\mathrm{d}\mu+\int_{K^c}X\mathrm{d}\mu=\int_{\Omega}X\mathrm{d}\mu$. It is an easy exercise in calculus to show that $xy\le z^2/4$ for $x,y,z\in\mathbb{R}$ with $x+y=z$. Therefore,
$$\left(\int_KX\mathrm{d}\mu\right)\left(\int_{K^c}X\mathrm{d}\mu\right)\le\frac{1}{4}\left(\int_{\Omega}X\mathrm{d}\mu\right)^2\le\frac{1}{4}\left(\int_{\Omega}|X|\mathrm{d}\mu\right)^2=\frac{1}{4}\left(\int_{\Omega}|X\cdot1|\mathrm{d}\mu\right)^2\\
\stackrel{\text{Hölder}}{\le}\frac{1}{4}\left(\left(\int_{\Omega}|X|^2\mathrm{d}\mu\right)^{1/2}\left(\int_{\Omega}1^2\mathrm{d}\mu\right)^{1/2}\right)^2=\frac{\mu(\Omega)}{4}\int_{\Omega}X^2\mathrm{d}\mu.$$
A: A slight variation on the argument of Thorgott (who posted while I was thinking about this):
Using the Cauchy-Schwarz inequality on each factor, we have
$$\begin{align*}
\left(\int_{K^c} X\,d\mu\right) \left(\int_K X\,d\mu \right) 
&\le \left(\mu(K^c) \cdot \int_{K^c} X^2\,d\mu \cdot \mu(K) \cdot \int_{K} X^2\right)^{1/2} \\
&= (\mu(K^c) \mu(K))^{1/2} \left( \int_{K^c} X^2\,d\mu \cdot \int_K X^2\,d\mu\right)^{1/2} \\
&\le \frac{1}{2}\left(\mu(K^c) + \mu(K)\right) \cdot \frac{1}{2} \left(  \int_{K^c} X^2\,d\mu + \int_K X^2\,d\mu\right)&& \text{(AM-GM)} \\
&= \frac{1}{4} \mu(\Omega) \int_{\Omega} X^2\,d\mu \end{align*}$$
where in the third line we used the arithmetic-mean-geometric-mean (AM-GM) inequality $\sqrt{ab} \le \frac{1}{2}(a+b)$.
A: Here is another solution based on the geometric-arithmetic mean inequality $\sqrt{ab}\leq\frac{a+b}{2}$ for $a,b\geq0$, which implies that $ab\leq\Big(\frac{a+b}{2}\Big)^2$.
\begin{aligned}
\Big(\int_K X\,d\mu\Big)\Big(\int_{K^c} X\,d\mu\Big)&\leq \Big|\int_K X\,d\mu\Big|\, \Big|\int_{K^c} X\,d\mu\Big|\leq \Big(\int_K |X|\,d\mu\Big)\Big( \int_{K^c} |X|\,d\mu\Big)\\
&\leq\left(\frac{\int_K |X|\,d\mu + \int_{K^c} |X|\,d\mu}{2}\right)^2=\frac14\Big(\int_\Omega|X|\,d\mu\Big)^2
\end{aligned}
Then by Hölder's inequality, $\int_\Omega|X|\,d\mu\leq \mu^{1/2}(\Omega)\|X\|_2$. Putting things together gives
$$
\Big(\int_K X\,d\mu\Big)\Big(\int_{K^c} X\,d\mu\Big)\leq \frac14\mu(\Omega)\int_\Omega|X|^2\,d\mu$$
