Let $X$ be a compact Hausdorff space and $C(X)$ the commutative algebra of continuous complex-valued functions endowed with the maximum-norm.
Let $J\subset C(X)$ be an ideal and $g\in J$. Let $0<\epsilon <1$. Show there exists a $u\in J $ such that $u = 1$ on the set $\{|g(x)|\geq 1\}$ and $u=0$ on $\{|g(x)|\leq \epsilon \}$ and $0\leq u(x)\leq 1$ for all $x\in X$.
The existence of such continuous $u\in C(X)$ is just an applications of Urysohn's lemma. But to show there exists such $u\in J$ I can't yet figure out.
Since $J$ is an ideal, it would be enough to show that there exists a $f\in C(X)$ such that $fg=u$. This would mean that $f=1/g$ on $\{|g(x)|\geq 1\}$ and $f=0$ on $\{0<|g(x)|\leq \epsilon\}$.
But I don't see why such $f$ would be continuous. Any ideas?
You have the desired $u$ by Urysohn's lemma. Now define $U_1 = \{x : \lvert g(x)\rvert > \varepsilon/3\}$ and $U_2 = \{ x : \lvert g(x)\rvert < 2\varepsilon/3\}$. By the continuity of $g$, both $U_1$ and $U_2$ are open, and since $2\varepsilon/3 > \varepsilon/3$, we have $X = U_1 \cup U_2$. Then define
$$f(x) = \begin{cases} \frac{u(x)}{g(x)} &, x\in U_1\\ 0 &, x\in U_2. \end{cases}$$
$f$ is well-defined because on $U_1\cap U_2$, we have $u \equiv 0$.
Evidently $f$ is continuous on $U_2$, and on $U_1$, it is also continuous, as the quotient of two continuous functions, where the denominator doesn't vanish. Hence $f$ is continuous on all of $X$.