This question is the converse of Sufficient conditions on $F$ such that $F(X)\in\mathcal{L}^{p}$ for all $X\in\mathcal{L}^{p}$.
Let $F : \mathbb{R} \to \mathbb{R}$ be a Borel function with the following property: for every Borel probability measure $\mu$ on $\mathbb{R}$ having finite first moment (i.e. $\int |x|\,d\mu < \infty$), we have $\int |F|\,d\mu < \infty$. (In probability language, this says that whenever $X$ is an integrable random variable on any probability space, then $F(X)$ is integrable too; let $\mu$ be the law of $X$.)
Must $F$ have linear growth? That is, does there necessarily exist a constant $C$ such that $|F(x)| \le C(1+|x|)$ for all $x \in \mathbb{R}$?
I thought about a closed graph theorem argument, but here the map $X \mapsto F(X)$ is a nonlinear mapping of $L^1$.
Suppose that $F$ has superlinear growth. Then we can find a sequence $x_n \to +\infty$ (or $x_n \to -\infty)$ such that $|F(x_n)/x_n|\;\uparrow +\infty$.
Wlog lets assume that $x_n \to +\infty$ and that $x_n\geq 0$.
Let us now construct a probability measure $\mu$ on $\Bbb R$ for which $\int |F|d\mu = +\infty$ while $\int |x|d\mu<+\infty$. This measure will be supported on the $x_n$, i.e., $\mu(\{x_n\})=\rho_n$ with $\sum_n \rho_n=1$.
So we need to find $\rho_n$ summing to $1$ such that $$\sum_n x_n\rho_n<+\infty.\;\;\;\;\;\;\;\; \sum_n |F(x_n)|\rho_n=+\infty.$$
Since $|F(x_n)|/x_n$ diverges, we can find a sequence $\alpha_n \downarrow 0$ such that $\sum_n \alpha_n<+\infty$, but $\sum_n \alpha_n|F(x_n)|/x_n=+\infty$. So now define $\rho_n = c\alpha_n/x_n$, where $c=\big(\sum_n \alpha_n/x_n\big)^{-1}.$
Hence by contrapositive, if $F$ satisfies your condition, then it must have linear growth (at worst).