Continuity at a Point (Local Property) Can anyone please explain me the following paragraph regarding limits and continuity?:

One thing to note about continuity is that it is a local property. What this means is that, for any $a \in \mathbb{R}$, if two functions $f$ and $g$ are equal on an open interval containing $a$, then either both $f$ and $g$ are continuous at $a$ or both are discontinuous at $a$. This is because they have the same value at $a$ and the same limit at $a$ (if these exist).

I don't clearly understand what 'local property' means.
Moreover, I think that the statement "if two functions $f$ and $g$ are equal on an open interval containing $a$, then either both $f$ and $g$ are continuous at $a$ or both are discontinuous at $a$" is false. Here's a counterexample that I came up with:
Let $a = 0$, $f(x) = x^2 + 1$, $g(x) = \left\{
\begin{array}{ll}
      x & \text{if } x\neq 0 \\
      1& \text{if } x = 0
\end{array} 
\right.$
Here, $f$ is continuous at $x = 0$ while $g$ is not. Yet both are equal at $x = 0$.

Edit: thank you for pointing out my error. I was wondering if there is any need for the interval to be open? Why can it not be a closed interval containing $a$?
 A: The statement is correct, and your misunderstanding here is subtle: in your coubterexample, $f$ and $g$ are equal at $a$ but not in an open interval containing $a$. When the author says continuity is a local property, they mean that if there is some open interval $(x, y)$ on which the functions are equal at ALL points in that interval (not just at one or a few points), then they are either both continuous or both not continuous at each point $a$ in that interval. The reason the term local is used is that it doesn't matter how small the interval is, as long as you can find some tiny interval containing $a$ for which the functions are equal everywhere in it, their continuity/discontinuity will be the same at $a$. It is "local" because all that matters is the behavior points which are sufficiently close to $a$, and not points that are "further away". However, it must be some interval of the point, not just the point itself, on which the functions are equal. 
The term local property is used a lot, and always means "only small intervals around a point matter, not large ones". However, the actual value of a function at the point is usually not that important to its local behavior. 
A: This term "local property" needs to be elaborated a bit more in the context of calculus / analysis.
The term refers to some property possessed by a function at a point. Thus the value of a function at a point is a local property. However the important and subtle part (which many beginners may fail to notice) here is that often the local property includes the behavior of a function not just at a point but rather at points near to the point under consideration.
This requires the use of a technical term neighborhood. A neighborhood of a point $c$ is any open interval $I$ which contains $c$. And then comes the dilemma: If a property of a function is defined by means of a neighborhood of a point $c$ then this necessarily involves the behavior of function at points other than $c$, then how come this remains local and related only to point $c$.
To answer this we may observe the fundamental as well as simple theorem (prove it yourself as it is too easy) :

Theorem: If $a, b$ are two distinct points ie $a, b\in\mathbb {R}$ and $a\neq b$ then there is a neighborhood $I$ of $a$ and a neighborhood $J$ of $b$ such that $I\cap J=\emptyset$.

Thus even when one considers the behavior of a function in a neighborhood of a point $c$ then there are ways to ensure that this property is related to one specific point and may not be possessed by it at another point.
Note further that a local property is not destroyed by changing the value of a function at a finite number of points ie if a function $f$ possesses a local property $P$ at point $c$ and we change the value of $f$ at a finite number of points different from $c$ then the modified function still possesses this property $P$ at $c$. But as a rule we can not change the values of $f$ at an infinite number of points different from $c$ and still preserve the property $P$ at $c$. Thus essentially local properties involve the point under consideration and often they also involve an infinite number of points near it. 
