Direct way to check if a random variable is $W_T$ measurable Inspired by this:
Calculate stochastic integral $\int_0^T s^2 W_s dW_s$ ,
I was asking myself this question:
Given a stochastic integral:
$I=\int_0^T f(W_s) ds$
is there a direct way to check if it is $W_{T}$-measurable ?
I tried to do a calculation for $f(W_s)=W_s$ and I wanted to ask:

*

*if my calculations/reasonings make sense and are conceptually correct ( even if the might be an overkill )

*if there are other ways that do not use the Ito formula to prove the same (maybe that can be applied to a generic $f$?).

I thought this ( a bit intuitively ):
Prop: $I$ is $W_T$ measurable iff $Var(I|W_T)=0$.
The idea is that if $I$ is already $W_T$ measurable, it is a function of $W_T$ and therefore its variance given $W_T$ should vanish.
If the proposition is true, than we can evaluate:
$Var(I|W_T)=\int_0^T \int_0^T cov(W_sW_{s'}|W_T) dsds'=2 \int_0^{T}d{s'}\int_0^{s'}ds \ cov(W_sW_{s'}|W_T)$
, where now in the covariance we have $s<s'<T$, just for convenience.
Now using that for a Brownian motion $E[W_uW_t]=min(u,t)$, that the joint of $W_s,W_s',W_T$ is Gaussian, we can evaluate the conditional covariance (I may add a bit more details on the calculation):
$cov(W_sW_{s'}|W_T)=s-\frac{ss'}{T}$
and finally:
$Var(I|W_T)=\frac{T^3}{24}>0$
Note that $Var(I|W_T)$ could have been a function of $W_T$ but, according to my calculations, it is not. Anyway this is positive and therefore we can conclude (?) that $I$ is not $W_T$-measurable ?
 A: Under an additional smoothness assumption I show that the integral $I=\int_0^Tf(W_s)\,ds$ is not $W_T$-measurable unless $f$ is constant:
Lemma. Assume
$$\tag{1}
\int_0^Tf(W_t,t)\,dt=g(W_T,T)
$$
holds for all $T$ where $g(x,t)$ is twice differentiable in $x$ and differentiable in $t$. Then, both $f$ and $g$ don't depend on $x\,.$ In particular, only the integral with deterministic integrand is trivially $W_T$-measurable.
Recall that $W_T$ measurability of the integral is, by the  Dynkin-Doob lemma, equivalent to the existence of a Borel measurable $g(x,t)$ that satisfies (1). The assumption of smoothness helps to simplify the matters.
Proof. Assume (1). Then by Ito's formula
\begin{align}
f(W_t,t)\,dt=g_x(W_t,t)\,dW_t+\frac{1}{2}g_{xx}(W_t,t)\,dt+g_t(W_t,t)\,dt\,.
\end{align}
This implies
\begin{align}
0&=g_x(x,t)\,,\quad 0=g_{xx}(x,t)\,,\tag{2}\\
f(x,t)&=g_t(x,t)\,.\tag{3}
\end{align}
The first of equations (2) means that $g$ cannot depend on $x\,.$ Therefore, if (1) holds,
$f$ cannot depend on $x$ (by (3)) and both sides of (1) must be deterministic.
