Let me first introduce the restricted setting in which this question has a nice answer. I came up with this when messing around with a homework problem in a PDE class a couple years back.


Let $\phi \in C^2[0,1]$. It induces a function $\phi\_\*: L^2[0,1] \to L^2[0,1]$, $f \mapsto \phi\circ f$. One can ask whether $\phi\_\*$ is continuous with respect to the weak topology on $L^2[0,1]$: Does $f\_n \rightharpoondown f \Rightarrow \phi(f\_n) \rightharpoondown \phi(f)$?.


By looking at the function $f(x)=r\cos(n\pi x)+x\_0$, one can get a necessary condition on $\phi$, that $\phi''(x\_0)=0$ for all $x\_0$. I.e. $\phi(x)=ax+b$. This is obviously sufficient too. Here's how you get the condition: 


Assuming the continuity of $\phi\_\*$ with respect to the weak topology: $$\int\_{-r+x\_0}^{r+x\_0}\frac{\phi(z)}{\sqrt{r^2-(z-x\_0)^2}}=\int\_{[0,1]} \phi(x\_0+r\cos(n\pi x))dx$$


$$=\langle \text{weak limit of } \phi(x\_0+r\cos(n \pi x)),1 \rangle $$


$$=\langle \phi(\text{weak limit of } (r\cos(n \pi x)+x\_0)),1\rangle=\langle \phi(x\_0),1\rangle=\phi(x\_0).$$ So if $\phi''(x\_0)>0$ for some $x\_0$, one can find a small ball $B\_r(x\_0)$ where $\phi''>0$ and the extreme LHS won't be the extreme RHS. Similarly $\phi''$ is not less than 0 anywhere.


My question for stackexchange is whether this is something that is well studied? It has to be. It is such a simply phrased question. If that is too vague, my question for you is what happens when one removes the differentiability conditions on $\phi$, and one looks at the induced function on $L^2[\text{non compact euclidean space}]$. This argument doesn't even work in higher dimensions so I am at a loss to see how to generalize what I did above.



Which functions are continuous with respect to the weak topology?
Consider the sequence $f\_k:[0,1]^n\to\mathbb{R}$ defined by $f\_k(x\_1,\dots,x\_n):=(-1)^{\sum\_{j=1}^n \lfloor kx\_j \rfloor}$: it converges weakly to $0$. 
For any $\phi:\mathbb{R}\to\mathbb{R}$, and for any $a$ and $b$ in $\mathbb{R}$, there holds: $$\phi\circ (a+bf\_k)=\frac{\phi(a+b)+\phi(a-b)}{2}+\frac{\phi(a+b)-\phi(a-b)}{2}\, f\_k$$
so assuming $f\to \phi\circ f$ is sequentially continuous wrto the weak topology of $L^2[0,1]^n$ and taking weak limits we get 
$$\phi (a)=\frac{\phi(a+b)+\phi(a-b)}{2}.$$


Thus, testing the weak continuity along all sequences $a+bf\_k$, we conclude that $\phi$ must be an affine function. 


