I'm trying to solve the following question:
Let $(X,d)$ be a metric space. We call a continuous function $f:X\to \mathbb R$ "good function" if for every continuous function $g:X\to \mathbb R$, the set: $S=\{x\in X;f(x)g(x)=1\}$ be a compact subset of $X$. Prove that the the addition of two good function is good.
My idea is the following:
Let $f:X\to \mathbb R$ be a good function and $r\neq 0$ be any real number and $g:X\to \mathbb R$ be arbitrary continuous function. Then, the set: $$S_r=\{x\in X;f(x)g(x)=r\}$$ is compact to. And when $r=0$, the set: $$S_0=\{x\in X;f(x)g(x)=0\}$$ is close in $X$. Now, let $f_1,f_2:X\to \mathbb R$ be tow good function's. Define: $$S_r(g)=\{x\in X;f_1(x)g(x)=r \,\,\,and\,\,\, f_2(x)g(x)=1-r\}$$ Then, for every $r\in \mathbb R$, the set $S_r(g)$ is compact and: $$S=\{x\in X;\,(f_1(x)+f_2(x))g(x)=1\}=\cup_{r\in \mathbb R}S_r(g)$$ Now, if $\{y_n\}_{n\in \mathbb N}\subset S$ be on arbitrary sequence. If infinitely many of $\{y_n\}_{n\in \mathbb N}$ belong to $S_{r_0}(g)$ for some $r_0 \in\mathbb R$, then because of $S_{r_0}(g)$ is compact, the sequence $\{y_n\}_{n\in \mathbb N}$ has a convergence subsequence. But when for every $r\in \mathbb R$, almost finitely term's of $\{y_n\}_{n\in \mathbb N}$ belong to $S_r(g)$, how can I prove that $\{y_n\}_{n\in \mathbb N}$ has a convergence subsequence?