Let be $f : \Bbb R^n \to \Bbb R$ monotone over all lines (not affine ones, but if there is an answer over affine lines, I'm interested.)
Is it possible to find $h : \mathbb{R} \to \Bbb R$ monotone and $l : \Bbb R^n \to \Bbb R$ linear so that $f = h \circ l$ ?
I tried to look by supposing I have such a factorization, and as $\ker l$ is a hyperplane, I have $n - 1$ lines where $f$ is constant. I tried to use the monotonicity condition by trying to compare $f(0)$ and over lines, but it didn't work.
Your factorization implies that $f$ is measurable (see $f: \mathbf{R} \rightarrow \mathbf{R}$ monotone increasing $\Rightarrow$ $f$ is measurable). But you can construct a non measurable $f$ monotone over all lines.
EDIT 1: Construction of $f$.
Take $$\varphi:{\Bbb R}^{n - 1}\longrightarrow{\Bbb R}$$ non measurable, and positive, $\eta$ monotone and positive. The function $$g(x) = \varphi(x_1,\dots,x_{n-1}) + \eta(x_n)$$ will be non measurable. Define $f$ in the upper half-space via a stereographic-projection-like bijection transforming the half-lines with constant $(x_1,\dots,x_{n-1})$ (domain of $g$) in rays (domain of $f$). Define $f(0) = 0$. Define $f$ using symmetry in the open lower half-space. Complete $f$ in the rest of space respecting your condition. Done.
EDIT 2: The bijection.
$$\sigma:(x_1,\dots.x_n)\longmapsto\frac{(x_1,\dots,x_{n-1},1)}{\|(x_1,\dots,x_{n-1},1)\|}\,x_n,$$ $f$ in the open upper half-space: $$f = g\circ\sigma^{-1}.$$