Expectation of a function according to a family of distributions Consider a family of smooth, atomless CDFs, $F_x(\cdot)$, for each $x \in \mathbb R$. Suppose that $F_x(\cdot)$ are FOSD ranked in $x$. That is, for any $x, x'$ such that $x \ge x'$, $F_x(\cdot) \le F_{x'}(\cdot)$.
Let $K > 0$ be a fixed scalar. I want to know whether there exists a function $g(\cdot)$ and a number $y^*$ such that
\begin{align*}
g(y) =& 0 & \text{ if } y < y^*\\ 
g(y) >& 0 & \text{ if } y \ge y^*\\ 
\mathbb{E}_{y}[g(\cdot)] =& K &  \forall y \ge y^*\\
\mathbb{E}_{y}[g(\cdot)] \le& K &  \forall y < y^*
\end{align*}
where $\mathbb E_y[g(\cdot)] = \int_{\mathbb R} g(\cdot) d F_y(\cdot)$.
I primarily want to know what is the right language to pose such a question. What should I be looking at? Is it optimal transport or something?
Thanks!
 A: $\newcommand\R{\mathbb R}$This is true for some first order stochastic dominance (FOSD) families but not all of them.
Indeed, if $F_x$ does not depend on $x$ and $c:=E_x1_{[y_*,\infty)}>0$, then just let $g:=\dfrac Kc\,1_{[y_*,\infty)}$.
On the other hand, suppose that $F_x$ is the cdf of $Z+x$, where $Z$ is a standard normal random variable. Then the family $(F_x)_{x\in\mathbb R}$ is FOSD. Suppose now that there exist some real $K,y_*$ and some Lebesgue-measurable function $g$ such that $g=0$ on $(-\infty,y_*)$ and $g>0$ on $[y_*,\infty)$ such that
$$h(y):=E_y g=K$$
for all real $y\ge y_*$. Then
$$K=h(y)=Eg(Z+y)=\int_\R g(z+y)f(z)\,dz=\int_\R g(u)f(y-u)\,du$$
for all $y\ge y_*$, where $f$ is the standard normal pdf. Since
$$f(z+t)=e^{-t^2/2}f(z)e^{-tz}, \tag{1}$$
the derivatives $h^{(k)}$ of all natural orders $k$ of the function $h$ exist and and for all $y>y_*$
$$0= h^{(k)}(y)=\int_\R g(u)f^{(k)}(y-u)\,du=(-1)^k\int_\R g(u)H_k(y-u)f(y-u)\,du,$$
where the $H_k$'s are the "probabilist's" Hermite polynomials. So, by the completeness property of the Hermite polynomials, the function $g$ must be constant, which contradicts the conditions that $g=0$ on $(-\infty,y_*)$ and $g>0$ on $[y_*,\infty)$. Thus, in this case no function $g$ with the desired properties exists. (This conclusion can also be obtained from (1) and the fact   that, if the moment generating function (mgf) of a distribution is everywhere finite, then the distribution is characterized by the values of the mgf on any nonempty open interval -- cf. e.g. this post.)
(The condition that $E_y g\le K$ for $y<y_*$ is redundant: it follows from the condition that $E_y g=K$ for $y\ge y_*$ and the FOSD condition.)
