This proposition is proved in case $E$ is a normed vector space. I'm trying to generalize it to topological vector space. Could you have a check on my attempt?
Let $E$ be a real vector space, $f:E \to \mathbb R$ linear and not constant, and $\alpha \in \mathbb R$. Then $H =\{x \in E \mid f(x) = \alpha\}$ is called an affine hyperplane. If $E$ is a real topological vector space, then $H$ is closed if and only if $f$ is continuous.
My attempt: The direction $\implies$ is clear. Let's prove the reverse. Assume that $H$ is closed and thus $H^c$ is open. Because $f$ is not constant, there exist $a \in H^c$ and an open neighborhood $U$ of $0_E$ such that $U +a \subseteq H^c$.
Consider the map $T:\mathbb R \times E \to E, (t, x) \mapsto tx$. Clearly, $T$ is continuous. Then there open neighborhoods $V_1$ of $0_{\mathbb R}$ and $V_2$ of $0_E$ such that $T (V_1 \times V_2) \subseteq U$. There is $t_1 >0$ such that $I := (-t_1, t_1) \subseteq V_1$. Then $U' := \bigcup_{t \in I} t V_2 \subseteq U$ is a symmetric neighborhood of $0_E$, i.e., $U' = - U'$. WLOG, we assume $U' = U$.
We claim that $f(U)$ is unbounded. If not, for each $M \in \mathbb R$, there is $x_M \in U$ such that $|f(x_M) |> M$. Then $(-M, M) \subseteq f(Ix_M)$ and thus $f(U) = \mathbb R$. So there is $b \in U$ such that $f(b + a) = \alpha$, which is a contradiction. So $f(U)$ is bounded. Hence there is $t_2 >0$ such that $f(U) \subseteq (-t_2, t_2)$.
Let $N := (-t_3, t_3)$ be a neighborhood of $0_\mathbb R$. Then $f \left (\frac{t_3}{t_2}U \right) \subseteq N$. It follows that $f$ is continuous at $0_E$ and hence $f$ is continuous.