I'd like to understand a little more about the restriction on a line to prove the convexity of a function. Indeed, we can show that a function $f(x)$ is convex if the function $g(t) = f(x + tv)$ is convex $\forall x$ and $x + tv \in dom f$.
I'll illustrate my lack of understanding with an example:
Let $f(x) = x1x2$ on $\mathbb{R^{2}_{++}}$, we want to know if it's convex. We define $$g(t) = f(x + tv) = (x1 + tv1)(x2 + tv2) = (v1v2)t^2 + (x1v2 + x2v1)t + x1x2$$ and its second derivative is $$g''(t) = 2v1v2$$ Now comes my misunderstanding, in which set should I consider v? If $v \in \mathbb{R^{2}_{++}}$ then I can conclude that f is convex (which is false). But if $v \in \mathbb{R^{2}}$ then I can't say that $x + tv \in dom f$.
I don't understand how to deal with restriction on a line when the function's definition set is not $\mathbb{R^{n}}$
Thanks for your time