In fact, Wikipedia says that the Stone-Weierstrass theorem can be extended to continuous real-valued functions over an arbitrary Hausdorff and compact topological space $X$.
It particular: this means that if $f$ is a continuous real-valued function defined on any closed and bounded subset $X \subset \mathbb{R}^n$ for any $n\in \mathbb N$, then for any $\epsilon > 0$, there exists a polynomial $p(x_1,\dots,x_n)$ such that
$$
|f(x_1,\dots,x_n) - p(x_1,\dots,x_n)| < \epsilon
$$
For any $(x_1,x_2,\dots,x_n) \in X$.
This certainly includes the $n$-dimensional rectangles $X = [a_1,b_1]\times \cdots \times [a_n ,b_n]$.
The first part a) is easy: We have $h(J) = \bigcap_{f \in J} f^{-1}(\{0\})$. Since every $f \in J$ is continuous, this set is closed as the intersection of the closed sets $f^{-1}(\{0\})$. In b) obviously $k(E)$ is also an ideal. Here we denote $\pi_x \colon C(X) \rightarrow \mathbb{R}$ the projection on the point $x$, i.e. $\pi_x(f) = f(x)$. Then $\pi_x$ is continuous and $k(E) = \bigcap_{x \in E} \pi_x^{-1}(\{0\})$, i.e. $k(E)$ is closed. (One can also argue by using sequences in order to prove that $k(E)$ is sequentially closed and thus closed, since $C(X)$ is a metric space.)
c) can be shown as follows: First, let $x \in E$, then for any $f \in k(E)$ we have $f(x)=0$. Thus $x \in h(k(E))$ by definition. SInce $h(k(E))$ is closed, we have $\overline{E} \subset h(k(E))$. On the other hand, for any $x \notin \overline{E}$, there exists by Urysohn's lemma a function $f \colon X \rightarrow [0,1]$ with $f(x) =1$ and $f(y) =0$ for all $y \in \overline{E}$. Thus $f \in k(E)$ by definition and, because $f(x) =1$, we get $x \notin h(k(E))$.
Let us prove now d): Let $f \in J$, then for any $x \in h(J)$ we have $f(x) =0$. Thus $f \in k(h(J))$. Since this set is closed, we also get $\overline{J} \subset k(h(J))$. Now, we use the hint: Let $U = X \subset h(J)$. This is a open set and is not necessary compact.
Counterexample: If $X=[0,1]$ we can take $x_0 =0$ and the maximal ideal $J = \{f \in C([a,b]): f(x_0) =0\}$, then $h(J) = \{0\}$. Thus $X \setminus h(J) = (0,1]$ is not compact.
For any $\varepsilon >0$ we can cover $h(J)$ with finite many open sets $V_1,\ldots,V_n$ such that $|f(x)| < \varepsilon$ for fixed $f \in k(h(J))$, because $h(J)$ is compact. Set $V = V_1 \cup \ldots \cup V_n$. Then $K^c = V^c = V_1^c \cap \ldots \cap V_n^c$ is compact in $X$ and hence also in $U$. We verified that $k(h(J)) \subset C_0(U)$. Note that this set is a closed subalgebra of $C_0(U)$.
Thus $\mathcal{A}:= \overline{J}$ is a closed subalgebra of $C_0(U)$. By definition for any $x \in U$ there exists at least one $f_x \in J$ with $f_x(x) \ne 0$. Let $x,y \in U$ are different points, we can use Urysohn's lemma to find functions $h_x$ and $h_y$ with $h_x(x)=1$ and $h_x(z) = 0 $ for $z \in h(J) \cup \{y\}$, resp. $h_y(y)=1$ and $h_y(y) = 0$ for $z \in h(J) \cup \{x\}$. Now define
$$h(z) := h_x(z) \frac{f_x(z)}{f_x(x)} - h_y(z) \frac{f_y(z)}{f_y(y)}.$$
Then $h \in J$ with $h(x) =1 \neq -1 =h(y)$. Hence $\mathcal{A}$ separates points and also vanishes nowhere. Stone-Weierstraß already shows that $\mathcal{A} = C_0(U)$ and thus $\mathcal{A} = k(h(J))$.
The last part is now a consequence of the previous ones: If $E$ is a closed set in $X$, then $k(E)$ is a closed ideal in $C(X)$ with $h(k(E)) =E$. On the other hand, any closed ideal $J$ in $C(X)$ gives a closed set $h(J)$ with $k(h(J)) = J$.
Best Answer
If $f \in C_\infty(X)$ (that is, $f$ has a continuous extension $\tilde{f}$ to $\tilde{X}$ with $\tilde{f}(\infty) = 0$), and you have a
$$h = b + c\cdot g \in B \oplus \{g\}$$
with $b\in B,\, c \in \mathbb{R}$, and
$$\lVert f - h\rVert_\infty \leqslant \varepsilon,$$
that tells you something about $c$ which in turn yields a useful estimate for
$$\lVert f-b\rVert_\infty.$$
Namely,
$$\varepsilon \geqslant \lVert f-h\rVert_\infty \geqslant \lvert f(\infty) - h(\infty)\rvert = \lvert f(\infty) - b(\infty) - c\cdot g(\infty)\rvert = \lvert c\rvert,$$
and hence
$$\lVert f - b\rVert_\infty = \lVert f - h + c\cdot g\rVert_\infty \leqslant \lVert f-h\rVert_\infty + \lvert c\rvert\cdot \lVert g\rVert_\infty \leqslant \varepsilon + \varepsilon.$$