Assume that $n=d+1$. The graph $\Gamma=\{(x,f(x))\mid x\in\mathbb R^d\}$ of $f$ is a $d$-dimensional subset of $\mathbb R^{d+1}=\{(x,z)\mid x\in\mathbb R^d,z\in\mathbb R\}$. Consider a line $L_0\subset\mathbb R^{d+1}$ included in the hyperplane $\{(x,0)\mid x\in\mathbb R^d\}\subset\mathbb R^{d+1}$, say the line $L_0=\{(x_0+tv_0,0)\mid t\in\mathbb R\}$ passing through $x_0$ with direction $v_0\ne0$.
Then, $L_0$ defines a vertical plane $P_0=L_0\times\mathbb R=\{(x_0+tv_0,z)\mid t\in\mathbb R,z\in\mathbb R\}\subset\mathbb R^{d+1}$ and, by definition, $P_0\cap \Gamma=\{(x_0+tv_0,f(x_0+tv_0)\mid t\in\mathbb R\}$.
On the other hand, the graph $G_0$ of the function $g_0:\mathbb R\to\mathbb R$, $t\mapsto g_0(t)=f(x_0+tv_0)$ is $G_0=\{(t,f(x_0+tv_0))\mid t\in\mathbb R\}\subset\mathbb R^2$. There is a natural bijection $\pi_0:P_0\to\mathbb R^2$ defined by $\pi_0(x_0+tv_0,z)=(t,z)$. One sees that $\pi_0(\Gamma)=G_0$.
The result says that $f$ is convex if and only if every $g_0$ is convex. This translates in terms of epigraphs as follows.
Recall that the epigraph of $f$ is $\Gamma^+=\{(x,z)\mid x\in\mathbb R^d,z\in\mathbb R,z\geqslant f(x)\}$. The epigraph of $g_0$ is $G_0^+=\{(t,z)\mid t\in\mathbb R,z\in\mathbb R,z\geqslant g_0(t)\}=\{(t,z)\mid t\in\mathbb R,z\in\mathbb R,z\geqslant f(x_0+tv_0)\}$. Thus, $\Gamma^+\subset\mathbb R^{d+1}$, $G_0^+\subset\mathbb R^2$, $\pi_0(\Gamma^+)=G_0^+$, and $f$ is a convex function if and only if $\Gamma^+$ is a convex subset of $\mathbb R^{d+1}$. The result is that this happens if and only if every $G_0^+$ is a convex subset of $\mathbb R^{2}$.
Finally, each line $L_0$ defines a hyperplane $P_0$ which may be seen as a slice of $\mathbb R^{d+1}$ cutting the epigraph $\Gamma^+$ through $G_0^+$ thanks to the identification between $P_0$ and $\mathbb R^2$ provided by $\pi_0$. The convexity of $f$ is defined through its behaviour on the lines only, hence $f$ is a convex function if and only if $\Gamma^+$ is a convex set if and every if every $G_0^+$ is a convex set if and only if every $g_0$ is a convex function.
1] By restricting it to a line means, basically, you draw line in the domain of the function; then you evaluate your function only along that line.
2] Imagine a paraboloid $f:\mathbb{R}\times\mathbb{R} \mapsto \mathbb{R}$ defined by $f(x,y) = \frac{x^2}{a^2} + \frac{y^2}{b^2}$.
$\hskip2in$ ![Paraboloid](https://i.stack.imgur.com/hB4Dm.png)
Now, if you draw a line in the domain and evaluate this paraboloid only along that line, it would look like a parabola. Analytically, if you want to check how the function would be along the x-axis, then substitute y = 0 in the equation above and you get $f(x,y) = \frac{x^2}{a^2}$ which you might know is the equation for the parabola. Now, a parabola is convex and since every line in the domain here would give you a parabola, a paraboloid is convex. On the other hand, if you take a hyperbolic paraboloid:
$\hskip2in$ ![hyperbolicparaboloid](https://i.stack.imgur.com/FvQNt.gif)
You draw a line in the domain in one direction, it would look like a parabola and you draw a line in the domain in another direction, it would look like an inverted parabola. Now, inverted parabolas are concave and not convex. Therefore, hyperbolic paraboloids are not convex.
- Images have been borrowed from the internet.
Best Answer
I am always interested in proving math theorem intuitively, so here I am.
purpose: Assume $ f:\mathbb{R}^m \rightarrow \mathbb{R} $, $g:\mathbb{R} \rightarrow \mathbb{R}$, so the theorem indicates the convexity of $f$ equals the convexity of $g$, in other words, we can check the convexity of $f$ by checking the convexity of functions of one variable.
intuitive Prove: assume $f:\mathbb{R}^2 \rightarrow \mathbb{R}$, just like the figure1 shows below.f(x). we want to check the convexity of $f(x)$.
we cut out a cross-section of $f(x)$ just like figure1 shows.
Then we get a new function (red line) which we call $g(t)=f(x+tv)$, notice $ x+tv $ is a line if we fix x which located in domain of f and arbitrary v. so if we iterate every lines that intersects domain of $f(x)$, we could get infinite $g(t)$, if we make sure these $g(t)$ are convex, then the original function $f(x)$ is convex too.