It is known that if a real random variable $X$ is independent of some sigma algebra $\mathcal{A}$, then almost surely: $$E(X|\mathcal{A})=E(X).$$
I was wondering if there is any kind of converse for this statement (with maybe other assumptions). More precisely, I am looking for a statement of the form : "if $X$ has some property and $E(X|\mathcal{A})=E(X)$, then $X$ is independent of $\mathcal{A}$.
Perhaps something like this (?):
$X$ is independent from $\mathcal A$ if and only, if $\mathbb E(f(X)|\mathcal A) = \mathbb E(f(X))$ for all measurable and non-negative $f$.
"$\Rightarrow$": Since $X$ is independent from $\mathcal A$, so is $f(X)$.
"$\Leftarrow$": Let $f$ be measurable and positive and $A\in \mathcal A$. Then
$$\mathbb E(f(X)1_A) = \mathbb E( \mathbb E(f(X)1_A|\mathcal A)) = \mathbb E(1_A \mathbb E(f(X)) = \mathbb P(A)\mathbb E(f(X))$$ Hence $X$ is independent from $\mathcal A$.
Depending on your definition / knowledge of independence you may need to employ a monotone class argument to conclude the independence in the last sentence.