A function $f : \Bbb R^n \to \Bbb R$ is convex if and only if the function $g : \Bbb R \to \Bbb R$ given by $g(t) = f(x + ty)$ is convex (as a univariate function) for all $x$ in domain of $f$ and all $y \in \Bbb R^n$. (The domain of $g$ here is all $t$ for which $x + ty$ is in the domain of $f$.)
I saw this theorem online however I can't understand what it really means. I know what convexity is but this is just too confusing, can someone please explain it.