$X$ and $Y$ are two random variables with joint probability density function $f_{XY}(x,y)$, $w(x)$ is any probability density function and $z$ is a value in the support of $X$: choose $w(x)$ such that $$\mathbb{V}_{f_{XY}}\left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)$$ is minimum.
First of all, we have that $$\mathbb{E}_{f_{XY}}\left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right) = \iint\frac{f_{XY}(z,y)w(x)}{f_{XY}(x,y)}f_{XY}(x,y)dxdy= \iint f_{XY}(z,y)w(x)dxdy = \int f_{XY}(z,y)\left( \int w(x)dx \right)dy=\int f_{XY}(z,y)dy=f_{X}(z)$$ where the integrals are over the full support of the variables.
So, we can write the variance as $$\mathbb{V}_{f_{XY}}\left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)=\mathbb{E}_{f_{XY}}\left( \left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)^2\right) - \left(\mathbb{E}_{f_{XY}}\left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)\right)^2 = \mathbb{E}_{f_{XY}}\left( \left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)^2\right) - \left(f_{X}(z)\right)^2 $$
For Jensen, the following holds $$ \mathbb{E}_{f_{XY}}\left( \left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)^2\right) \geq \left(\mathbb{E}_{f_{XY}}\left(\frac{f_{XY}(z,Y)w(X)}{f_{XY}(X,Y)}\right)\right)^2= \left(f_{X}(z)\right)^2 $$
If I find a $w(\cdot)$ such that the strict equality holds, that $w(\cdot)$ is the solution. At this point, I don't know how to get the solution, that I know it should be $w(x)=f_{X\,\vert\, Y}(x\mid y)$
Any help would be greatly appreciated, thanks!