Let $A$ and $B$ be subsets of $M$ and let $f: M \rightarrow \mathbb{R}$. Prove or disprove the following statements: Let $A$ and $B$ be subsets of $(M,d)$ and let $f: M \rightarrow \mathbb{R}$. Prove or disprove the following statements:


*

*If $f$ is continuous at each point of $A$ and $f$ is continuous at each point of $B$, then $f$ is continuous at each point of $A \cup B$.

*If $f|_{A}$ is continuous, relative to $A$ and $f|_{B}$ is continuous, relative to B, then $f|_{A \cup B}$ is continuous, relative to $A \cup B$.


If either statement is not true in general, what modifications are necessary to make it so ?
My attempt:
let, $A = (0, 1]$ and $B = (2,3]$ then we can see that if $f$ is continuous at A and $f$ continuous at B but $f$ is not continuous at $A \cup B$. 
The second part of the problem is true! and I am able to show it. 
Update:
For the first part of the problem let $(x_{n})$ be a sequence in A converging to $x$ since f is continuous then $f(x_{n}) \rightarrow f(x)$
Similarly, for $y_{n} \rightarrow y$ for $(y_{n})$ is a sequence in B and $y$ is a point in $B$. We have $f(y_{n}) \rightarrow f(y)$
Hence, for any $(z_{n})$ in $A \cup B$ and $z_{n} \rightarrow z$  for $z \in A \cup B$ clearly, $f(z_{n}) \rightarrow f(z)$. Which proves 1. of the problem. 
 A: It seems to me that you have two questions. Question 1 concerns the rules of logic, Question 2 is about the concept of continuity.
Let me start with 1. in your question. This only concerns logic. To realize this, let us consider a simple example which hopefully will clarify this point.
Let $M = \mathbb  R$ and $A, B$ be subsets of $\mathbb  R$. If each point of$A$ is a rational number and each point of $B$ is a rational number, then each point of $A \cup B$ is a rational number.
This should be obvious (or "trivial" as I said in a comment). The general pattern is this: Suppose we have a set $M$ and a statement $P(x)$ which is defined for all $x \in M$. If $P(x)$ is true for all $x  \in A$ and all $x \in B$, then $P(x)$ is true for all $x  \in A \cup B$. As Lee Mosher comments, this is due to the definition of the union of sets. In your question $P(x)$ is the statement "$f$ is continuous at $x$". In my above example $P(x)$ is the statement "$x$ is a rational number".
Let us next come to continuity. I do not know which definition you use. There is a standard definition for maps between general topological spaces. If you only consider metric spaces, the following definition  is equivalent to the standard definition:
Let $X,Y$ be metric spaces. A function $f : X \to Y$ is continuous at $x \in X$ if for each sequence $(x_n)$ in $X$ which converges to $x \in X$ the sequence $(f(x_n))$ in $Y$ converges to $f(x) \in Y$.
Thus your update is not correct. The continuity of $f : M \to \mathbb R$ at a point $x \in M$ has nothing to do with the sets $A, B$. That $f$ is continuous at $x \in A$ does not mean "Let $(x_n )$ be a sequence in $A$ converging to $x$. Then $f(x_n) \to f(x)$". It means "Let $(x_n )$ be a sequence in $M$ converging to $x \in A$. Then $f(x_n) \to f(x)$".
What you erroneously stated for 1. applies to 2. The restriction of $f$ to $A$, denoted by $f \mid_A$, is a function defined on the metric subspace $A  \subset M$ with values in $\mathbb R$; points outside of $A$ are "unknown" to $f \mid_A$. That $f \mid_A$ is continuous means that "Let $(x_n )$ be a sequence in $A$ converging to $x \in A$. Then $f(x_n) \to f(x)$". 
Here is an example that 2. is not true in general. Let $M = [0,1], A = [0,1), B= \{ 1\}$ and $f : [0,1] \to \mathbb R, f(x) = 0$ for $x \in [0,1)$ and $f(1) = 1$. The maps $f \mid_A$ and $f \mid_B$ are constant, hence continuous. But $f$ is not continuous in $1$.
If you require in addition that both $A,B$ are open or closed in $M$, then $f \mid_{A \cup B}$ is continuous.
