Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
i take it from your wording that $X$ here is a subset of $\mathbb{R}$? – citedcorpse Jun 12 '13 at 12:28
up vote 1 down vote accepted

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$.

share|cite|improve this answer
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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.