[proofplan]
Bundle the functionals $g_1, \ldots, g_n$ into a single linear map $T: E \to \mathbb{F}^n$, $T(x) = (g_1(x), \ldots, g_n(x))$, so that $\ker(T) = \bigcap_i \ker(g_i)$. The hypothesis $\ker(T) \subseteq \ker(f)$ means $f$ is constant on the cosets of $\ker(T)$, hence factors through $E / \ker(T) \cong \operatorname{Im}(T)$ as a linear functional $\tilde{f}$ on the subspace $\operatorname{Im}(T) \subseteq \mathbb{F}^n$. Extend $\tilde{f}$ linearly to all of $\mathbb{F}^n$ (every linear functional on a subspace of a finite-dimensional space extends, e.g. by setting it to zero on a complementary subspace). The extension has the form $(y_1, \ldots, y_n) \mapsto \sum_i a_i y_i$ for scalars $a_i$, so $f(x) = \tilde{f}(T(x)) = \sum_i a_i g_i(x)$ for all $x \in E$, exhibiting $f$ as a linear combination of $g_1, \ldots, g_n$.
[/proofplan]
[step:Bundle the functionals into a single map $T : E \to \mathbb{F}^n$]
Let $\mathbb{F} \in \{\mathbb{R}, \mathbb{C}\}$ be the scalar field of $E$. Define
\begin{align*}
T : E &\to \mathbb{F}^n \\
x &\mapsto (g_1(x), \ldots, g_n(x)).
\end{align*}
Linearity of each $g_i$ implies linearity of $T$: for $x, y \in E$ and scalars $\alpha, \beta$,
\begin{align*}
T(\alpha x + \beta y) = (g_i(\alpha x + \beta y))_{i=1}^n = (\alpha g_i(x) + \beta g_i(y))_{i=1}^n = \alpha T(x) + \beta T(y).
\end{align*}
The kernel of $T$ is $\ker(T) = \{x \in E : g_i(x) = 0 \text{ for all } i\} = \bigcap_{i=1}^n \ker(g_i)$, and the hypothesis becomes
\begin{align*}
\ker(T) \subseteq \ker(f).
\end{align*}
[/step]
[step:Define a linear functional $\tilde{f} : \operatorname{Im}(T) \to \mathbb{F}$ via factorisation through $T$]
Let $V := \operatorname{Im}(T) \subseteq \mathbb{F}^n$, a linear subspace. We define
\begin{align*}
\tilde{f} : V &\to \mathbb{F} \\
T(x) &\mapsto f(x).
\end{align*}
**Well-definedness.** If $T(x) = T(x')$ for $x, x' \in E$, then $T(x - x') = 0$, i.e. $x - x' \in \ker(T) \subseteq \ker(f)$, so $f(x - x') = 0$, i.e. $f(x) = f(x')$. Hence the value of $\tilde{f}$ at a point $y \in V$ is independent of the choice of preimage $x \in T^{-1}(\{y\})$.
**Linearity.** For $y_1 = T(x_1), y_2 = T(x_2) \in V$ and scalars $\alpha, \beta$,
\begin{align*}
\tilde{f}(\alpha y_1 + \beta y_2) = \tilde{f}(T(\alpha x_1 + \beta x_2)) = f(\alpha x_1 + \beta x_2) = \alpha f(x_1) + \beta f(x_2) = \alpha \tilde{f}(y_1) + \beta \tilde{f}(y_2),
\end{align*}
using the linearity of $T$ to identify $\alpha y_1 + \beta y_2$ with $T(\alpha x_1 + \beta x_2)$ and the linearity of $f$ in the middle equality.
**Factorisation.** By construction, $f(x) = \tilde{f}(T(x))$ for all $x \in E$, i.e. $f = \tilde{f} \circ T$.
[/step]
[step:Extend $\tilde{f}$ to a linear functional $\hat{f}$ on $\mathbb{F}^n$]
The subspace $V \subseteq \mathbb{F}^n$ is finite-dimensional with $\dim V \leq n$. Choose a complementary subspace $W \subseteq \mathbb{F}^n$ with $\mathbb{F}^n = V \oplus W$ (possible because every subspace of a finite-dimensional space has a complement: extend a basis of $V$ to a basis of $\mathbb{F}^n$ and let $W$ be the span of the added basis vectors).
Define
\begin{align*}
\hat{f} : \mathbb{F}^n &\to \mathbb{F} \\
v + w &\mapsto \tilde{f}(v) \quad (v \in V, w \in W).
\end{align*}
The decomposition $\mathbb{F}^n = V \oplus W$ guarantees that the components $v \in V$ and $w \in W$ of any $y \in \mathbb{F}^n$ are uniquely determined, so $\hat{f}$ is well-defined. Linearity of $\hat{f}$ follows from the linearity of $\tilde{f}$ and the fact that the decomposition $y = v + w$ is itself $\mathbb{F}$-linear in $y$. By construction, $\hat{f}|_V = \tilde{f}$.
[/step]
[step:Identify $\hat{f}$ as a linear combination of coordinate functionals on $\mathbb{F}^n$]
Let $e_1, \ldots, e_n$ be the standard basis of $\mathbb{F}^n$. Define $a_i := \hat{f}(e_i) \in \mathbb{F}$ for $i = 1, \ldots, n$. For any $y = (y_1, \ldots, y_n) \in \mathbb{F}^n$, linearity of $\hat{f}$ gives
\begin{align*}
\hat{f}(y) = \hat{f}\Big(\sum_{i=1}^n y_i e_i\Big) = \sum_{i=1}^n y_i \hat{f}(e_i) = \sum_{i=1}^n a_i y_i.
\end{align*}
This is the standard identification of the dual of $\mathbb{F}^n$ with $\mathbb{F}^n$ via the standard basis: every linear functional on $\mathbb{F}^n$ is a fixed linear combination of the coordinate projections.
[/step]
[step:Conclude $f = \sum_{i=1}^n a_i g_i$]
For any $x \in E$, combining the previous steps:
\begin{align*}
f(x) = \tilde{f}(T(x)) = \hat{f}(T(x)) = \sum_{i=1}^n a_i \, T(x)_i = \sum_{i=1}^n a_i g_i(x),
\end{align*}
where the first equality is the factorisation of Step 2, the second is $\hat{f}|_V = \tilde{f}$ from Step 3 (with $T(x) \in V$), the third is the formula of Step 4, and the fourth uses $T(x)_i = g_i(x)$ from Step 1.
Therefore $f = \sum_{i=1}^n a_i g_i \in \operatorname{span}\{g_1, \ldots, g_n\}$, completing the proof.
[/step]