Write 1D for the function equal to 1 on D and 0 elsewhere, and N=Ω∖Ω∗. Since P is a probability measure and P(Ω)=P(Ω∗)+P(N) by additivity, P(N)=0.
A null-integrand fact. If f:Ω→R is a nonnegative random variable vanishing at every point of Ω∗, then E[f]=0. Indeed, every simple function s with 0≤s≤f vanishes on Ω∗, so each set on which s takes a nonzero value is contained in N and therefore has probability 0 by monotonicity of the measure; hence the integral of s is 0. Taking the supremum over such s, which is the definition of the integral of a nonnegative measurable function, gives E[f]=0.
Claim 1. The difference X−Y is a random variable, being the composition of the sequentially continuous map (u,v)↦u−v on R2 with the map having components X and Y, by measurability of sequentially continuous functions of measurable Euclidean maps. Put Z=max(X−Y,0); this is a random variable, since for a real number c the set {Z>c} equals Ω when c<0 and equals {X−Y>c} when c≥0.
At every point of Ω we have 0≤Z≤2K, and at every point of Ω∗ we have Z=0 by hypothesis. By the null-integrand fact, E[Z]=0. Since X−Y≤Z at every point of Ω, linearity and monotonicity of the integral give
E[X]−E[Y]=E[X−Y]≤E[Z]=0.
Claim 2. If X=Y on Ω∗, then both X≤Y and Y≤X hold on Ω∗, so Claim 1 applied twice gives E[X]≤E[Y] and E[Y]≤E[X].
Claim 3. The constant functions with values c and −c are random variables bounded in absolute value by max(K,c), with expectations c and −c. On Ω∗ we have X≤c and −c≤X, so Claim 1, applied with the bound max(K,c) in place of K, gives E[X]≤c and −c≤E[X], that is ∣E[X]∣≤c.
Claim 4. Put W+=max(W,0) and W−=max(−W,0), both random variables by the argument used for Z in Claim 1, both nonnegative, with W=W+−W− and W−≤K′ at every point of Ω.
First, E[U1N]=0: the two nonnegative random variables max(U,0)1N and max(−U,0)1N vanish on Ω∗, so both have expectation 0 by the null-integrand fact, and their difference is U1N. Hence E[U1Ω∗]=E[U] by linearity.
Next, W+1N is nonnegative and vanishes on Ω∗, so E[W+1N]=0 and therefore E[W+]=E[W+1Ω∗], both sides possibly infinite a priori. At every point of Ω we have W+1Ω∗≤U1Ω∗: on Ω∗ this is the hypothesis ∣W∣≤U, and off Ω∗ both sides vanish. Monotonicity of the integral therefore gives
E[W+]=E[W+1Ω∗]≤E[U1Ω∗]=E[U],
which is finite. The same argument applied to W−, which also satisfies W−≤U on Ω∗, gives E[W−]≤E[U], and E[W−] is finite in any case because 0≤W−≤K′.
Hence W is integrable, with E[W]=E[W+]−E[W−]. Both E[W+] and E[W−] lie in the interval from 0 to E[U], so their difference has absolute value at most E[U], that is ∣E[W]∣≤E[U]. ■