If $f$ is continuous on $2$ subsets, is it also continuous on the union? Sorry if this has been asked already, my searches on continuity for the union of two sets just gets me results for uniform continuity.
$(M,d)$ is a metric space. Let $f:M\to\Bbb R$ and let $A\subset M$ and $B\subset M$.  If $f$ is continuous at every point in $A$ and at every point in $B$, then is $f$ continuous at  every point of $A\cup B$?
Now I would say yes, $A\cup B$ consists of {$x$: $x\in A$ or $x\in B$}
And since $f$ is continuous at every point in $A$ and every point in $B$.
Any help/guidance or anything else is appreciated.
 A: Define the function $f: (0,2) \rightarrow \mathbb{R}$ as $$f(x) = \left\{ \begin{array}{ccc}x& & x\in(0,1)\\ x+1& & x\in[1,2)\end{array}\right.$$
This $f$ is continuous on $A=(0,1)$ and $B=[1,2)$ but not on $A\cup B$.
However, if $A$ and $B$ are either both open or both closed and the function value agrees on their intersection then $f$ will be continuous.
A: Language abiguities may be causing confusion here. The assumption "$f$ is continuous at each point of $A$" can  mean that if $x\in A$ and $\epsilon>0,$ then there exists $\delta>0$ such that if $y\in M$ and $d(y,x)<\delta,$ then $|f(y)-f(x)|<\epsilon.$ Same thing for "$f$ is continuous at each point of $B.$" If this is the understanding, then it is obvious that $f$ is continuous at each point of $A\cup B.$
But sometimes "$f$ is continuous at each point of $A,$" might be shortened to "$f$ is continuous on $A$". However, the latter often means $f|_A$ is continuous with respect to the metric space $A.$ That is a different thing. So if we have $f$ continuous on $A$ and on $B,$ with this understanding, then it is certainly possible that $f$ is not continuous on $A\cup B,$ meaning $f|_{A\cup B}$ is not continuous with respect to the metric space $A\cup B.$ The older answer shows this.
Given that, the first order of business should be to understand precisely the mathematics of the situation. What are the precise definitions, assumptions, and conclusions in play here?
