I am trying to understand how many functions $f:\mathbb R\to \mathbb R$ such that $$\int f(g(x))\mathrm d x=f\left ( \int g(x)\mathrm d x \right) \tag{$\star$}$$ for every $g:\mathbb R \to \mathbb R$ exist. We shall refer to a function satisfying $(\star)$ as an I-linear function.
It is easy to show that the identity function is I-linear. Moreover, the space of I-linear functions forms a vector space because if $f_1,f_2$ are I-linear $$ \begin{align}(\alpha f_1+\beta f_2) \left (\int g(x)\mathrm d x \right ) &= \alpha f_1 \left (\int g(x)\mathrm d x \right)+\beta f_2 \left ( \int g(x)\mathrm d x \right) \\ &= \alpha \int f_1(g(x))\mathrm d x+\beta \int f_2(g(x))\mathrm d x\\ &= \int (\alpha f_1+\beta f_2)(g(x))\mathrm d x \end{align}$$
As a consequence, all scalar multiples of identity are I-linear functions. This claim is essentially equivalent to stating the obvious $\int \alpha f=\alpha \int f$.
Observe that if $f$ is both I-linear and differentiable, by setting $g(x)=e^x$ and differentiating $(\star)$ one obtains $$f(e^x)=e^xf'(e^x+C)=\frac{\mathrm d}{\mathrm d x}f(e^x+C)$$ which looks almost like a differential equation.
Questions:
- Under no regularity hypotheses on $f$, is it possible to show that if $f$ is I-linear, then $f(x)=\alpha x$ for some $\alpha$? To do so, it would be sufficient to show that the vector space of I-linear functions is $1$-dimensional.
- If the claim is false under no regularity hypotheses, is it possible to add these to prove our claim?
The problem is not fully specified. You must say for what class of functions $g$ the equality is supposed to hold. I suppose this class contains at least piecewise constant functions.
Then $(\star)$ implies that $f$ is a linear map. No need to assume anything about the regularity of $f$.
Additivity
Take for example a function $g$ that takes value $a$ on an interval of length 1 and $b$ on an interval of length 1 (intervals are disjoint) and $0$ anywhere else. Then :
Thus $f(a+b)=f(a)+f(b)$
Homogeneity
Now take $g$ that is $a$ on an interval of length $\lambda$ ($0$ anywhere else) :
But it only works for non negative $\lambda$ (it is the length of an interval). Finally we need to prove $f(-x)=-f(x)$. It is a consequence of the previous paragraph with $a=-b$.
So : $f(\lambda a)=\lambda f(a)$
Any function that is a solution is a linear map. The only linear maps on $\mathbb{R}$ are $x\mapsto \alpha x$.
Note that the proof for additivity is "overkill" (not really needed) when we are in $\mathbb{R}$. But this allows to generalize the result when $f$ is $\mathbb{R^p}\to \mathbb{R^q}$.