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.