[proofplan]
Both parts reduce to the [Hahn-Banach (Semi-Norm Version)](/theorems/2628). For (i), continuity of $g$ on $Y$ produces, via the [Continuity of Linear Maps Between Locally Convex Spaces](/theorems/2636), a seminorm estimate $|g(y)| \le C \max_k p_k(y)$. The function $p(x) := C \max_k p_k(x)$ is a seminorm on the whole of $X$, and the seminorm Hahn-Banach extends $g$ to a linear $f$ on $X$ dominated by $p$ — which is precisely the seminorm bound that the lcs continuity criterion needs. For (ii), define $g$ on $Z := \operatorname{span}(\{x_0\} \cup Y)$ by $g(y + \lambda x_0) := \lambda$; closedness of $Y$ in $X$ makes $\ker(g) = Y$ closed in $Z$, so $g \in Z^*$ by the [Continuity via Closed Kernels](/theorems/2637) criterion. Apply (i) to extend.
[/proofplan]
[step:Extract a seminorm estimate from $g \in Y^*$]
Let $Y$ inherit the lcs structure from $X$: the topology on $Y$ is generated by the restricted seminorms $\{p|_Y : p \in \mathcal{P}\}$. By the [Continuity of Linear Maps Between Locally Convex Spaces](/theorems/2636) applied to $g: Y \to \mathbb{F}$ (with codomain $\mathbb{F}$ topologised by the single seminorm $q(t) = |t|$), there exist $C \ge 0$, $n \in \mathbb{N}$, and $p_1, \ldots, p_n \in \mathcal{P}$ such that
\begin{align*}
|g(y)| \le C \cdot \max_{1 \le k \le n} p_k(y) \quad \text{for all } y \in Y.
\end{align*}
[guided]
Why does $g \in Y^*$ produce such an estimate? The [Continuity of Linear Maps Between Locally Convex Spaces](/theorems/2636) characterises continuity from an lcs $(X, \mathcal{P})$ to an lcs $(Z, \mathcal{Q})$ by: for every $q \in \mathcal{Q}$, there exist $C \ge 0$ and finitely many $p_1, \ldots, p_n \in \mathcal{P}$ with $q(T(x)) \le C \max_k p_k(x)$.
Here the codomain is $\mathbb{F}$ with the standard topology, which equals the lcs topology generated by the single seminorm $q(t) := |t|$. The induced topology on the subspace $Y$ is generated by $\{p|_Y : p \in \mathcal{P}\}$. So $g$ continuous on $Y$ is equivalent to: there exist $C \ge 0$, $n \in \mathbb{N}$, and $p_1, \ldots, p_n \in \mathcal{P}$ with $|g(y)| \le C \max_k p_k(y)$ for $y \in Y$. (A subtle point: the seminorms supplied by the theorem live on the ambient space $X$, since the topology on $Y$ inherits its seminorms from $\mathcal{P}$ via restriction; we will reuse them on $X$ in the next step.)
[/guided]
[/step]
[step:Apply the seminorm Hahn-Banach to extend $g$]
Define $p: X \to \mathbb{R}$ by $p(x) := C \cdot \max_{1 \le k \le n} p_k(x)$. We verify $p$ is a seminorm:
- **Non-negativity:** Each $p_k \ge 0$, so $\max p_k \ge 0$ and $p \ge 0$.
- **Positive homogeneity:** $p(\lambda x) = C \max_k p_k(\lambda x) = C \max_k |\lambda| p_k(x) = |\lambda| p(x)$.
- **Subadditivity:** $p_k(x + y) \le p_k(x) + p_k(y) \le \max_j p_j(x) + \max_j p_j(y)$ for each $k$, so taking the max over $k$ on the left gives $\max_k p_k(x+y) \le \max_j p_j(x) + \max_j p_j(y)$, and multiplying by $C$ gives $p(x+y) \le p(x) + p(y)$.
The estimate from the previous step gives $|g(y)| \le p(y)$ for all $y \in Y$. By the [Hahn-Banach (Semi-Norm Version)](/theorems/2628) (with $Y$ a subspace, $g: Y \to \mathbb{F}$ linear with $|g| \le p$ on $Y$), there exists a linear extension $f: X \to \mathbb{F}$ of $g$ satisfying
\begin{align*}
|f(x)| \le p(x) = C \cdot \max_{1 \le k \le n} p_k(x) \quad \text{for all } x \in X.
\end{align*}
[/step]
[step:Conclude $f \in X^*$ via the seminorm characterisation]
The estimate $|f(x)| \le C \max_{1 \le k \le n} p_k(x)$ on all of $X$ is exactly condition (iii) of the [Continuity of Linear Maps Between Locally Convex Spaces](/theorems/2636) for $f: X \to \mathbb{F}$ (with $\mathbb{F}$ topologised by $q(t) = |t|$). Therefore $f \in X^*$, and $f|_Y = g$ by construction. This proves (i).
[guided]
The seminorm Hahn-Banach gave us an extension dominated by $p$ on all of $X$. The [Continuity of Linear Maps Between Locally Convex Spaces](/theorems/2636) is the dictionary between such seminorm bounds and continuity for lcs maps to $\mathbb{F}$. So the bound $|f(x)| \le C \max_k p_k(x)$ — already in the standard form of condition (iii) of that theorem — is exactly continuity of $f$. Note that the constants $C, n$, and seminorms $p_k$ used here are the same ones obtained in Step 1: this is what makes the round trip work, $g \in Y^* \to \text{seminorm bound on } Y \to \text{seminorm bound on } X \to f \in X^*$.
[/guided]
[/step]
[step:For (ii), construct an auxiliary functional on $\operatorname{span}(Y \cup \{x_0\})$]
Now suppose $Y \subset X$ is a closed subspace and $x_0 \in X \setminus Y$. Set $Z := \operatorname{span}(\{x_0\} \cup Y) = \{y + \lambda x_0 : y \in Y, \lambda \in \mathbb{F}\}$ and define
\begin{align*}
g: Z &\to \mathbb{F} \\
y + \lambda x_0 &\mapsto \lambda.
\end{align*}
We check $g$ is well-defined and linear: if $y + \lambda x_0 = y' + \lambda' x_0$ in $Z$, then $(\lambda - \lambda') x_0 = y' - y \in Y$. If $\lambda \ne \lambda'$, then $x_0 = (\lambda - \lambda')^{-1}(y' - y) \in Y$, contradicting $x_0 \notin Y$. So $\lambda = \lambda'$, and $g$ is well-defined. Linearity is direct: $g(\alpha(y_1 + \lambda_1 x_0) + \beta(y_2 + \lambda_2 x_0)) = g((\alpha y_1 + \beta y_2) + (\alpha \lambda_1 + \beta \lambda_2) x_0) = \alpha \lambda_1 + \beta \lambda_2 = \alpha g(y_1 + \lambda_1 x_0) + \beta g(y_2 + \lambda_2 x_0)$.
By construction $g|_Y = 0$ (taking $\lambda = 0$) and $g(x_0) = 1$.
[/step]
[step:Show $g \in Z^*$ using closedness of $Y$ and the closed-kernel criterion]
The kernel of $g$ is $\{y + \lambda x_0 : \lambda = 0\} = Y$. We claim $Y$ is closed in $Z$. Equip $Z$ with the lcs topology induced by restricting the seminorms $\mathcal{P}$ to $Z$. The closure of $Y$ in $Z$ is $\overline{Y}^Z = \overline{Y}^X \cap Z$, where $\overline{Y}^X$ denotes closure in $X$. Since $Y$ is closed in $X$ by hypothesis, $\overline{Y}^X = Y$, so $\overline{Y}^Z = Y \cap Z = Y$, confirming $Y$ is closed in $Z$.
By the [Continuity via Closed Kernels](/theorems/2637) applied to the lcs $Z$ and the linear $g: Z \to \mathbb{F}$ with $\ker(g) = Y$ closed in $Z$, we conclude $g \in Z^*$.
[/step]
[step:Apply (i) to extend $g$ from $Z$ to $X$]
Apply part (i) of the present theorem to the subspace $Z \subset X$ and the continuous linear functional $g \in Z^*$: there exists $f \in X^*$ with $f|_Z = g$. Since $Y \subset Z$, we have $f|_Y = g|_Y = 0$, and $f(x_0) = g(x_0) = 1 \ne 0$. This proves (ii).
[/step]