Are functions considered continuous at endpoints? Consider a function $f(x)$ that has no jump, infinite, or removable discontinuities in the middle anywhere -- but maybe the domain is limited:


*

*Would the endpoint $[a,$ be considered continuous?

*What about the endpoint $(a,$? 
I ask because I often see "a function is continuous if we can draw it without lifting up the pencil" but I didn't know to what extent this applies to the endpoints and whether or not it matters if the points themselves are defined.
 A: The function is continuous iff it is continuous at each point of the domain,
so we need only consider points in the domain.
Hence, if the domain is of the form $(a,...$, the end point $a$ is of no concern
since it is not part of the domain. For example, $f(x) = {1 \over x}$ is
continuous on $(0,\infty)$. The point $0$ is not an issue since it is not part of
the domain.
If the domain has the form $[a,...$ then if $f$ is continuous at $x=a$ then
$f$ must have values close to $f(a)$ for $x$ close to $a$ (and in the domain). In particular, $f$ must be defined at $x=a$.
One characterization is for all sequences $x_n \to a$ (with $x_n $ in the domain)  we must have $f(x_n) \to f(a)$. This is equivalent to drawing the curve without lifting.
Illustrations:
The function $f(x) = -1 $ for $x \in [-1,0]$ and $f(x) = 1$ for $x \in (1,2]$, with
domain $[-1,0] \cup (1,2]$ is continuous everywhere.
The function $f(x) = -1 $ for $x \in [-1,0]$ and $f(x) = 1$ for $x \in (0,2]$, with
domain $[-1,2]$ is continuous everywhere except at $x=0$.
The function that is $0$ everywhere except at $x=0$ where $f(0) = 1$ is
continuous everywhere except at $x=0$. 
A: To answer this question, you need a better definition of continuity than "a  function is continuous if we can draw it without lifting up the pencil."  The definition that is usually the first rigorous definition that students see is

Let $D \subseteq \mathbb{R}$.  A function $f : D \to \mathbb{R}$ is continuous at a point $a\in D$ if for all $\varepsilon > 0$ there exists a $\delta > 0$ such that if $x\in D$ and $|x-a| < \delta$, then $|f(x) - f(a)| < \varepsilon$.

Here, the notation $f : D\to\mathbb{R}$ says that $f$ is a function with domain $D$ and codomain $\mathbb{R}$ (the real numbers).  In other words, $f$ takes real numbers from some set $D$ as input, and outputs other real numbers.  The definition of the domain is quite important here, as it specifies what kinds of objects or numbers $f$ can work with.
Next, the definition of continuity basically says that you set an error tolerance $\varepsilon$, and always find a region around $a$ such that choosing any value of $x$ in that region ensures that the output will be within your error tolerance.  
This definition says nothing about endpoints, and can be applied to such points as easily as any other, as long as they are in the domain of the function.  In particular, this means that if you define a function an an interval $[a,b]$, then it could be continuous at either $a$ or $b$.  On the other hand, if it is defined on $(a,b)$, then it cannot be continuous at either $a$ or $b$, as it is not defined there.
In either case, a function is continuous on its domain if it is continuous at every point in the domain.  Thus a function can be continuous on either $[a,b]$ or $(a,b)$.  In the former case the function would necessarily be continuous at $a$ and $b$ (if it is continuous on its domain), and in the latter case $f$ would not be continuous at either $a$ or $b$ as it is not even defined there.
