# problem concerning continuity of functions

Let $f,g:X \rightarrow \mathbb R$ be both continuous functions. Prove that if $X$ is open, then the set $A=\{ x \in X \mid f(x) \neq g(x) \}$ is also open. Show that if $X$ is closed, then $A=\{x \in X \mid f(x)=g(x)\}$ is closed.

Is there anyone who can help me to solve this problem?

-
i take it from your wording that $X$ here is a subset of $\mathbb{R}$? –  citedcorpse Jun 12 '13 at 12:28

Let $\varphi: S\to \mathbb R, x\mapsto f(x)-g(x)$ where $S$ is a topological space then $h$ is continuous function and we have $$A=\varphi^{-1}(\mathbb R^*)\cap X$$ is an open subset of $S$ as intersection of two open subset of $S$

For the second case we have $$A=\varphi^{-1}(\{0\})\cap X$$ is a closed subset since it's an intersection of two closed subset of $S$.

-
Needs an upvote to accompany GREEN! –  amWhy Jun 1 '14 at 12:06

Let $X$ be any topological space, and $f,g:X\rightarrow\mathbb{R}$ be continuous functions.

Difference of continuous functions is continuous. Consider $h:X\rightarrow \mathbb{R}$ that sends $x$ to $f(x)-g(x)$. $h$ is continuous.

$$A=\{x|f(x)\not=g(x)\}=h^{-1}[\mathbb{R}-\{0\}]$$ Hence $A$ is open, because $h$ is a continuous function and $\mathbb{R}-\{0\}$ is open. Similarly $\{x|f(x)=g(x)\}=h^{-1}[\{0\}]$ is a closed subset of $X$

To get the result of your question, Equip the set $X$ wth the inherited topology from $\mathbb{R}$ and apply the previous result.

-