Any counter-example of pasting lemma

general-topology

This is from Munkres:

Let $X = A \cup B$, where $A$ and $B$ are closed (open) in $X$. Let $f\colon A \rightarrow Y$, $g\colon B \rightarrow Y$ be continuous. If $f(x) = g(x)$ for every $x \in A \cap B$, then $f$ and $g$ combined to give a continuous $h\colon X \rightarrow Y$ by setting $h(x) = f(x)$ if $x \in A$, and $h(x) = g(x)$ if $x \in B$.

The proof is fairly straightforward, using the fact that inverse image of closed (open) map is closed. However, what happens if we drop closed (or open) condition? Are there any examples such that $f|_{A \cap B} = g|_{A \cap B}$, but $h\colon X \rightarrow Y$ is not continuous?

One example I can think of is: $A = [0,1] \cap \mathbb Q$ and $B = [0,1] \setminus \mathbb Q$, and $f = \chi_{A}, g = \chi_B$. Here, $h$ is inevitably discontinuous. However, $A \cap B = \varnothing$ in this case, and it will be wonderful if I can construct a function on $A, B$ such that $A \cap B$ is something non-trivial (by non-trivial, I mean finite). I would really appreciate any other insightful and exciting counterexample that can spark my mind!

Thank you in advance.

Best Answer

If you want $A\cap B\not=\emptyset$, you can just tweak the example you already have in some small way. For example, take $$f:\mathbb{Q}\rightarrow\mathbb{R}: a\mapsto 0,\quad g:(\mathbb{R}\setminus\mathbb{Q})\cup\{0\}\rightarrow\mathbb{R}: a\mapsto a.$$ Here $A=\mathbb{Q}$, $B=(\mathbb{R}\setminus\mathbb{Q})\cup\{0\}$, and so $A\cap B=\{0\}\not=\emptyset$. (In your example you've put everything inside $[0,1]$, but there's no need to do that.)

A similar tweak gets an infinite, indeed uncountable, intersection:

Just set $A=(-\infty,0]\cup\mathbb{Q}$, $B=(\mathbb{R}\setminus\mathbb{Q})\cup(-\infty,0]$, $f: A\rightarrow\mathbb{R}: a\mapsto 0$, and $$g:B\rightarrow \mathbb{R}: a\mapsto\max\{0,a\}.$$

Related Question