Let $f,g:X \to Y$ be continuous, $Y$ Hausdorff. Show $\{x:f(x)=g(x)\}$ is closed in $X$.

Here is my attempt.

We seek to show $\{x: f(x)=g(x)\}^c \subset X$ is open. That is we aim to show if $x_0 \in \{x:f(x)=g(x)\}^c$ there exists a neighborhood $U$ of $x_0$ such that $U \subset \{x:f(x)=g(x)\}^c$. If $x_0 \in \{x:f(x)=g(x)\}^c$ then $f(x_0) \neq g(x_0)$ which are in $Y$ who is Hausdorff thus there exists open sets $V,W \subset Y$ that are disjoint with

$$f(x_0) \in V, g(x_0) \in W.$$

By continuity of $f$ their pre-images, $f^{-1}(V),f^{-1}(W) \subset X$ are open in $X$ and contain $x_0$. So do I take the union or intersection of their pre-images to find my $U$ orrr?? Any hints greatly appreciated. Also, am I going about this the right way?? BTW this is exercise $\S$ $31.5$ out of Munkres.

  • $\begingroup$ The preimage of $V$ under f and the preimage of $W$ under g contain $x_0$. Both are open by continuity of f and g. Therefore their intersection is open and contains $x_0$. Their union might not be contained in your complement, but their intersection definitely is. Do you see why? $\endgroup$ Jan 8, 2023 at 17:54
  • $\begingroup$ @Meneer-Beer yes because if your in their intersection then you're in both original open set which are disjoint thus they cannot be equal (as they have disjoint neighborhoods) hence the intersection is in the complement. $\endgroup$
    – homosapien
    Jan 8, 2023 at 18:16
  • 1
    $\begingroup$ See also: The set of points where two maps agree is closed? (If your intention was mainly to get some feedback on your attempt, you should use the (solution-verification) tag.) $\endgroup$ Jan 8, 2023 at 18:54
  • $\begingroup$ And then there's two more answers here. $\endgroup$
    – amrsa
    Jan 8, 2023 at 18:54

2 Answers 2


You're going about this exactly the right way, you just need to finish off.

$V$ is an open neighbourhood of $f(x_0)$, $W$ an open neighbourhood of $g(x_0)$, and they are disjoint.

$f^{-1}(V)\cap g^{-1}(W)$ is an open neighbourhood of $x_0$ in $X$: let's call it $U$. If $x\in U$, then I know $f(x)\in V$ and $g(x)\in W$, and I know $V\cap W=\emptyset$, so it is not possible that $f(x)=g(x)$. That means: $$U\subseteq\{x\in X:f(x)\neq g(x)\}$$As desired.


There is another concise approach with net.

Let $A = \{x \in X \mid f(x) = g(x)\}$ and show that $A = \overline{A}$.

Proof: Suppose that $a \in \overline{A}$, then there exists a net $x = (x_{i})_{i \in I} \colon I \to A$ such that $\lim x = a$ (i.e. the net $x$ converges to $a$), by continuity at $a$, we have $\lim (f(x_{i}))_{i \in I} = f(a)$ and $\lim (g(x_{i}))_{i \in I} = g(a)$. Since $f(x_{i}) = g(x_{i})$ for each $i \in I$ and limits are unique in $Y$, hence $$f(a) = \lim (f(x_{i}))_{i \in I} = \lim (g(x_{i}))_{i \in I} = g(a)$$ that means $a \in A$. Thus $\overline{A} \subseteq A$.

  • $\begingroup$ Nets are always another nice alternative to proving things about continuity or compactness or even here using the fact that nets converge to unique limits in Hausdorff spaces. +1 for that. $\endgroup$
    – homosapien
    Jan 13, 2023 at 21:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .