approximately linear functions -- more Suppose $f,g$ are continuous functions from $\mathbb R$ to $\mathbb R$, with the property that 
$$f(x)+f(y)=g(x+y)$$
for all $x,y$. Taking $x=y=z/2$ implies that $g(x)=2f(x/2)$ so that the above condition becomes
$$f(x)+f(y)=2f((x+y)/2).$$
This is known as Jensen's functional equation, and it implies that $f$ is linear.
There's also a generalization of Jensen's equation (I've seen it in work of Rassias, but it could be earlier): if $|f(x)+f(y)-2f((x+y)/2)|\leq\epsilon$ (and assuming WLOG that $f(0)=0$), then there is a linear function $L$ such that $|f(x)-L(x)\|\leq \epsilon$.
What I am interested in a generalization of all this: Suppose there are independent random variables $X,Y$ such that 
$$E[(f(X)+f(Y)-g(X+Y))^2]\leq\epsilon.$$
Is it possible to say anything about $f$ being (appropriately) approximately linear?
 A: Comment : 
I think you could give more precision in the formulation of your question because you already have most of the answer. 
In particular:
1-Is the generalization of Jensen equation you give valid on Hilbert Space ? (seems to be true, see http://www.emis.de/journals/JIPAM/images/075_02_JIPAM/075_02_www.pdf)
2-What assumption do you make on the random variables? do they have the same distribution ? are their distribution "equivakent" (i.e mutually absolutly continuous) 
Answer:
If (the answer to my question 1 is yes and if) $X$ and $Y$ have the same distribution $P$, because $L_2(P)$ is a hilbert space then you are done. Here, approximate linearity will mean that there exists a linear form $L$ such that 
$E_P[(f(X)-L(X))^2]<\epsilon$. 
If $X$ and $Y$ have different distribution (say $P_X$ and $P_Y$) I see an easy case: when  $E_{P_Y}[( dP_X/dP_Y )^2] ) < c$ ($\chi^2$ divergence between distributions bounded). Indeed, in this case you can work in $L_2(P_Y)$ using cauchy swartz inequality. Otherwise the question needs to be clarifyed (i.e what do you mean by "approximatly linear"? : in what banach space do you choose to work ? ). 
Hope this helps ! 
