[proofplan]
We prove continuity of $f \circ g$ at $a$ directly from the relative $\varepsilon$-$\delta$ definition. Given an error tolerance for $f \circ g$, continuity of $f$ at $g(a)$ gives a tolerance for the input of $f$. Continuity of $g$ at $a$ then gives a neighbourhood of $a$ in $E$ on which $g(x)$ lies within that input tolerance, allowing the two estimates to compose.
[/proofplan]
[step:Declare the composition as a function on $E$]
Since $g: E \to F$ and $f: F \to \mathbb{R}$, the composition is the function
\begin{align*}
f \circ g: E &\to \mathbb{R}
\end{align*}
defined by $(f \circ g)(x)=f(g(x))$ for every $x \in E$. In particular, because $a \in E$, we have $g(a) \in F$, so the hypothesis that $f$ is continuous at $g(a)$ is well-typed.
[/step]
[step:Choose the tolerance for $g$ from continuity of $f$]
Let $\varepsilon > 0$ be given. Since $f: F \to \mathbb{R}$ is continuous at $g(a)$ relative to $F$, there exists $\eta > 0$ such that for every $y \in F$,
\begin{align*}
|y-g(a)| < \eta \implies |f(y)-f(g(a))| < \varepsilon.
\end{align*}
[guided]
We begin with the quantity that must be made small for continuity of $f \circ g$ at $a$, namely
\begin{align*}
|(f \circ g)(x)-(f \circ g)(a)|.
\end{align*}
By the definition of composition, this is
\begin{align*}
|f(g(x))-f(g(a))|.
\end{align*}
Thus the relevant continuity hypothesis is the continuity of $f$ at the point $g(a) \in F$.
Let $\varepsilon > 0$ be given. The relative continuity of $f: F \to \mathbb{R}$ at $g(a)$ says that there exists an input tolerance $\eta > 0$ such that every point $y \in F$ satisfying $|y-g(a)|<\eta$ also satisfies
\begin{align*}
|f(y)-f(g(a))| < \varepsilon.
\end{align*}
The restriction $y \in F$ matters because $f$ is only defined on $F$, not necessarily on all of $\mathbb{R}$.
[/guided]
[/step]
[step:Use continuity of $g$ to force $g(x)$ into the required tolerance]
Since $g: E \to F$ is continuous at $a$ relative to $E$, applied with the positive number $\eta$, there exists $\delta > 0$ such that for every $x \in E$,
\begin{align*}
|x-a| < \delta \implies |g(x)-g(a)| < \eta.
\end{align*}
[/step]
[step:Combine the two implications to prove continuity of the composition]
Let $x \in E$ satisfy $|x-a|<\delta$. By the choice of $\delta$,
\begin{align*}
|g(x)-g(a)| < \eta.
\end{align*}
Since $g(x) \in F$, the choice of $\eta$ applies with $y=g(x)$ and gives
\begin{align*}
|f(g(x))-f(g(a))| < \varepsilon.
\end{align*}
Using the definition of the composition at $x$ and at $a$, this is exactly
\begin{align*}
|(f \circ g)(x)-(f \circ g)(a)| < \varepsilon.
\end{align*}
Therefore, for every $\varepsilon>0$ there exists $\delta>0$ such that every $x \in E$ with $|x-a|<\delta$ satisfies the displayed inequality. Hence $f \circ g$ is continuous at $a$ relative to $E$.
[/step]