Function on convex set is convex if all rays are convex Consider the function $f:D\rightarrow\mathbb{R}$ for $D\subset\mathbb{R}^n$ an open convex set.  Furthermore, suppose that $g(t)=f(t\boldsymbol{x})$ is convex for all $\boldsymbol{x}\in D$.  Is it true that $f$ is convex?  Or is there a counter example?
I haven't been able to find a counter example.

The statement is trivially true for $n=1$, but false for all $n \ge 2$. As a counter-example, define
$$
   f: \mathbb R^n \to \mathbb R, \, f(x_1, x_2, \ldots, x_n) = | x_1\, x_2 |
$$
For fixed $\boldsymbol{x} = (x_1, x_2, \ldots, x_n)$,
$$
   g: \mathbb R \to \mathbb R, \,g(t) = f(t \boldsymbol{x}) = t^2 | x_1\, x_2 |
$$
is convex, but $f$ is not convex because
$$
   \frac 14 = f(\frac 12, \frac 12, 0, \ldots) \nleq 
 \frac 12 f(1, 0, 0, \ldots) + \frac 12 f(0, 1, 0, \ldots) = 0 \quad.
$$
