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

If two functions defined on metric spaces $X$ and $Y$ are equal on a dense subset of $X$ and are continuous also, then are they equal on all of the metric space $X$?

share|cite|improve this question
That does not seem to be a question, but an assertion. (It looks to be a true assertion, by the way). – Henning Makholm Sep 25 '12 at 17:35
Dear @HenningMakholm, I have another question: assume the two functions are $1/x$ on $\mathbb R \setminus \{0\}$. After extending them, can we say that they are equal at $0$? I asked this related question here. Can one say $\infty = \infty$? Probably, since otherwise the answer to this question would have to be "no". – Rudy the Reindeer Oct 18 '12 at 14:10
@MattN.: In this question, the functions were (at least in my understanding) supposed to already be continuous on the entire metric space; it was just the equality between them that was known only for a dense subset. It is true that "any two continuous functions $\mathbb R\to\mathbb R$ that are $1/x$ on $\mathbb R\setminus\{0\}$ are equal", but only vacuously so, because there are no such functions in the first place! – Henning Makholm Oct 18 '12 at 14:31
up vote 2 down vote accepted

This is correct. Suppose $f$ and $g$ are continuous functions on a metric space $X$ and agree on a dense subset $Y$. For any $x\in X$, we have some sequence $(y_n)$ in $Y$ such that $y_n\to x$, so $f(y_n)\to f(x)$ and $g(y_n)\to g(x)$. Since $f(y_n)=g(y_n)$ for all $n$, this implies $f(x)=g(x)$.

share|cite|improve this answer

Yes. The set of points where the functions $f,g\colon X\to Y$ agree is closed and contains a dense subset. The closure of a dense subset is $X$. (This does not require metric spaces, it is sufficient that $X$ is any topological space and $Y$ is Hausdorff)

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.