Let $X$ be an integrable real random variable. For any $-\infty<a<b<\infty$, define $Y$ as $X$ on the event $X\not\in [a,b]$, and otherwise define it as $a$ with probability $\frac{1}{b-a}\int_{X\in[a,b]}b-X d\mathbb{P}$ and as $b$ with probability $\frac{1}{b-a}\int_{X\in[a,b]}X-a d\mathbb{P}$. It is easy to show that by construction $\mathbb{E}Y=\mathbb{E}X$. It is known that $Y$ maximises the variance among all random variables $Y'$ coinciding with $X$ off $[a,b]$ and having same expectation as $X$. How does one show this? I tried various partitions of $\Omega$ and investigated $\text{Var}Y-\text{Var}X$, but could not reach the conclusion sought, so there must be another way.
Anybody familiar with the topic? Thanks a lot for any help.
Most of the scaffolding of this problem can be easily removed: write
$$E[X]=E[Y]=E[Y \mid X \in [a,b]] P[X \in [a,b]] + E[Y \mid X \not \in [a,b]] P[X \not \in [a,b]].$$
Some subtraction yields
$$E[Y \mid X \in [a,b]] P[X \in [a,b]] = E[X \mid X \in [a,b]] P[X \in [a,b]].$$
Now you can divide through to get
$$E[Y \mid X \in [a,b]] = E[X \mid X \in [a,b]].$$
Thus you can already assume WLOG that $X$ is supported on $[a,b]$ and then your hypothesis collapses to $E[Y]=E[X]$.
From there, yes, you can make the variance of $Y$ arbitrarily large if that's your only assumption.