I'm working with a problem the epigraph of a real-valued function $f$ is a halfspace $\iff$ $f$ is a real-valued affine fuction.
First, I quickly recall some definitions:
A (closed) halfspace is a set of the form $\{x:a^T\textbf{x} \le b \}$ for some $a \in \mathbb R^n,a \ne 0, b \in \mathbb R.$
epi$(f)=\{(\textbf{x},t):f(\textbf{x}) \le t \}$.
A real-valued function $f$ is affine if $f(\textbf{x})=c^T\textbf{x}+d$ for some $c \in \mathbb R^n,d \in \mathbb R.$
Second, I show my little attempt:
$"\Longleftarrow"$ Assume $f$ is a real-valued affine fuction then
$(\textbf{x},t) \in \text{epi}(f) \Leftrightarrow f(\textbf{x}) \le t$ $\Leftrightarrow c^T\textbf{x}+d \le t \Leftrightarrow c^T\textbf{x}\le t-d$.
The last inequality shows $c^T\textbf{x}\le t-d$, that means $\text{epi}(f)$ is a halfspace. Is that true?
$"\Longrightarrow"$ Assume epigraph of $f$ is a halfspace. We need to prove $f$ is affine.
I have some ideas but they didn't work. How can I continue?