[proofplan]
We prove each part separately using $\varepsilon$-$\delta$ arguments. For the sum and product, we exploit the [algebra of limits](/theorems/104) (sum of limits, product of limits) applied to the continuity condition $\lim_{x \to a} f(x) = f(a)$. For the quotient, we first show $1/g$ is continuous when $g(a) \neq 0$ by bounding $|g(x)|$ away from zero near $a$, then apply the product result. For composition, we chain two $\varepsilon$-$\delta$ arguments.
[/proofplan]
[step:Prove that $f + g$ is continuous at $a$]
Let $\varepsilon > 0$. Since $f$ is [continuous](/page/Continuity) at $a$, there exists $\delta_1 > 0$ such that $|x - a| < \delta_1$ implies $|f(x) - f(a)| < \varepsilon/2$. Since $g$ is continuous at $a$, there exists $\delta_2 > 0$ such that $|x - a| < \delta_2$ implies $|g(x) - g(a)| < \varepsilon/2$.
Let $\delta = \min(\delta_1, \delta_2)$. For $x \in E$ with $|x - a| < \delta$, the triangle inequality gives
\begin{align*}
|(f+g)(x) - (f+g)(a)| &= |f(x) - f(a) + g(x) - g(a)| \\
&\le |f(x) - f(a)| + |g(x) - g(a)| \\
&< \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon.
\end{align*}
[/step]
[step:Prove that $fg$ is continuous at $a$]
Since $f$ is continuous at $a$, there exists $\delta_3 > 0$ such that $|x - a| < \delta_3$ implies $|f(x) - f(a)| < 1$, hence $|f(x)| \le |f(a)| + 1$. Let $M = \max(|f(a)| + 1, |g(a)| + 1)$.
Given $\varepsilon > 0$, choose $\delta_1 > 0$ such that $|f(x) - f(a)| < \varepsilon/(2M)$ for $|x - a| < \delta_1$, and $\delta_2 > 0$ such that $|g(x) - g(a)| < \varepsilon/(2M)$ for $|x - a| < \delta_2$. Let $\delta = \min(\delta_1, \delta_2, \delta_3)$.
For $x \in E$ with $|x - a| < \delta$, add and subtract $f(x)g(a)$:
\begin{align*}
|f(x)g(x) - f(a)g(a)| &= |f(x)(g(x) - g(a)) + g(a)(f(x) - f(a))| \\
&\le |f(x)| \cdot |g(x) - g(a)| + |g(a)| \cdot |f(x) - f(a)| \\
&\le M \cdot \frac{\varepsilon}{2M} + M \cdot \frac{\varepsilon}{2M} = \varepsilon,
\end{align*}
where we used $|f(x)| \le M$ (from $\delta \le \delta_3$) and $|g(a)| \le M$.
[guided]
The key technique is the "add-and-subtract" trick: we insert $f(x)g(a)$ to split the product difference into two pieces, each involving only one function's deviation. Specifically:
\begin{align*}
f(x)g(x) - f(a)g(a) = f(x)\bigl(g(x) - g(a)\bigr) + g(a)\bigl(f(x) - f(a)\bigr).
\end{align*}
For the first term, we need $|f(x)|$ bounded, which is why we first secure $|f(x)| \le |f(a)| + 1$ via continuity of $f$. The constant $M$ is chosen large enough to dominate both $|f(x)|$ and $|g(a)|$, and then both $\delta_1$ and $\delta_2$ are calibrated to $\varepsilon/(2M)$ so the two terms contribute $\varepsilon/2$ each.
[/guided]
[/step]
[step:Prove that $f/g$ is continuous at $a$ when $g \neq 0$ on $E$]
It suffices to show $1/g$ is continuous at $a$ (the result then follows from the product rule above). Since $g$ is continuous at $a$ and $g(a) \neq 0$, there exists $\delta_0 > 0$ such that $|g(x) - g(a)| < |g(a)|/2$ for $|x - a| < \delta_0$. By the [reverse triangle inequality](/theorems/2300):
\begin{align*}
|g(x)| \ge |g(a)| - |g(x) - g(a)| > |g(a)| - \frac{|g(a)|}{2} = \frac{|g(a)|}{2} > 0.
\end{align*}
Given $\varepsilon > 0$, choose $\delta_1 > 0$ such that $|g(x) - g(a)| < \varepsilon |g(a)|^2 / 2$ for $|x - a| < \delta_1$. Let $\delta = \min(\delta_0, \delta_1)$. For $x \in E$ with $|x - a| < \delta$:
\begin{align*}
\left|\frac{1}{g(x)} - \frac{1}{g(a)}\right| = \frac{|g(a) - g(x)|}{|g(x)| \cdot |g(a)|} < \frac{\varepsilon |g(a)|^2 / 2}{(|g(a)|/2) \cdot |g(a)|} = \varepsilon.
\end{align*}
Therefore $1/g$ is continuous at $a$, and $f/g = f \cdot (1/g)$ is continuous at $a$ by the product result.
[/step]
[step:Prove that $h \circ f$ is continuous at $a$]
Let $\varepsilon > 0$. Since $h$ is continuous at $f(a)$, there exists $\eta > 0$ such that $|y - f(a)| < \eta$ implies $|h(y) - h(f(a))| < \varepsilon$. Since $f$ is continuous at $a$, there exists $\delta > 0$ such that $|x - a| < \delta$ implies $|f(x) - f(a)| < \eta$.
For $x \in E$ with $|x - a| < \delta$: setting $y = f(x)$, we have $|f(x) - f(a)| < \eta$, so
\begin{align*}
|(h \circ f)(x) - (h \circ f)(a)| = |h(f(x)) - h(f(a))| < \varepsilon.
\end{align*}
[guided]
The composition argument chains two $\varepsilon$-$\delta$ statements in an outside-in order. We need $|h(f(x)) - h(f(a))| < \varepsilon$. Since $h$ is [continuous](/page/Continuity) at $f(a)$, there exists $\eta > 0$ such that
\begin{align*}
|y - f(a)| < \eta \implies |h(y) - h(f(a))| < \varepsilon.
\end{align*}
Now $|f(x) - f(a)| < \eta$ is exactly a continuity condition on $f$ at $a$, so there exists $\delta > 0$ such that
\begin{align*}
|x - a| < \delta \implies |f(x) - f(a)| < \eta.
\end{align*}
Combining the two: for $|x - a| < \delta$, setting $y = f(x)$ gives $|y - f(a)| = |f(x) - f(a)| < \eta$, hence $|h(f(x)) - h(f(a))| < \varepsilon$. The order matters: we first obtain $\eta$ from the continuity of $h$ (the "outer" function), and then use $\eta$ as the target tolerance for the continuity of $f$ (the "inner" function) to obtain $\delta$.
[/guided]
[/step]