I think I found a flaw in the $\varepsilon$-$\delta$ definition of continuity. If I have a function $f(x)$ defined as follows.

*

*$f(x) = 1$ for all $x<1$ and $x>2$;

*$f(x) = 100$ for $x = 1.5$;

*$f(x)$ is undefined anywhere else.

According to the $\varepsilon$-$\delta$ definition of continuity, if I take $\delta$ as any positive number smaller than $0.5$, then $f(x)$ by definition is continuous at $x = 1.5$ because within the $\delta$-neighborhood there is only one point defined, but $f(x)$ is obviously not continuous at $x = 1.5$.
Below is the $\varepsilon$-$\delta$ definition of continuity:
The function $f(x)$ is continuous at a point $x_0$ of its domain if for every positive $\varepsilon$ we can find a positive number $\delta$ such that $$|f(x) - f(x_0)|<\varepsilon$$ for all values $x$ in the domain of $f$ for which $|x-x_0|<\delta$.
 A: Your example in fact shows that according to the formal definition of continuity, the function $f$ as you have defined it is continuous at $x=1.5$, and rather your informal suggestion that $f$ is "obviously not continuous at $x=1.5$" is actually mistaken.
A: A perhaps surprising fact is that any function $\mathbb Z\to\mathbb R$ is continuous, and your example is the same sort of thing. You can see this both using the epsilon-delta definition but also using the topological definition, which says that the inverse image of any open set has to be open: in the discrete topology, all sets are open so this is trivially true.
An informal way of describing continuity is that if you change the input to a function without jumping, the output also doesn't jump. If you can't change the input without jumping then that is vacuously true.
A: The function is "vacuously" continuous as you can't show a discontinuity.
A: Recall the definition of continuity at a point $a$: Let $f$ be a real-valued function defined on the set $D\subseteq \mathbb R$ and let $a\in D$. We say that $f$ is continuous at $a$ if, given any $\varepsilon > 0$ there is a $\delta >0$ such that
$$|f(x)-f(a)|<\varepsilon\text{ for all $\mathit{x\in D}$ with }|x-a|<\delta.$$
And the definition of an isolated point: Let $D\subseteq \mathbb R$. Then an element $a$ of $D$ is said to be an isolated point of $D$ if $a\in D$, but $a$ is not a limit point of $D$.
In your example, $D=(-\infty,1)\cup\{1.5\}\cup(2,\infty)$. So, $a=1.5$ is an isolated point of $D$.
If $a$ is an isolated point of $D$ then there is a positive $\delta$ such that $a$ is the only element of $D$ in $(a-\delta, a+\delta)$. In your case, you correctly identified $\delta=0.5$ as $1.5$ is the only element of $D$ in $(1,2)$. It follows that if $a$ is an isolated point of $D$ then every function is continuous at $a$, because, if we choose $\delta$ small enough then the only point of $D$ that satisfies the condition $|x-a|< \delta$ is $a$ itself (and the condition $|f(x)-f(a)|< \varepsilon$ is always satisfied when $x=a$).
A: (You should accept the top answer (LAGC), but this is too long for a comment.)
A lot of people learn that continuity means "you can trace it with a pencil."  This is a decent metaphor (it is an even better metaphor for "piecewise smooth"), but misleading in this case since the domain is not connected. I think this is why you thought your function shouldn't be continuous.
Another metaphor which, while not perfect, is more useful in this case is "it doesn't rip the domain apart." This metaphor would lead you to suspect that your function is continuous, which the formal definition proves is true.
A: Though the question is now answered still I would like to add one more point-
The condition in the definition is for the domain of the function. The function you defined has no domain point in set $A = (1,2)\setminus\{1.5\}$; and thus when you consider $\delta<0.5$ in the nbd of $1.5$ you are actually at some point of the domain in $\mathbb{R} - (1,2)$.
A: For such cases exist conception of continuity with respect to some set $E$, for example Rudin W. - Principles of mathematical analysis,1976, 85p. In isolated points of $E$ function is continuous exactly because there is only one point $x \in E$ for some neighborhood.
So, sometimes, it's better to write well known facts again.
A: I'm probably missing something here, but it seems like this function is actually discontinuous at x=1.5 by the epsilon-delta definition of continuity.  Recall the definition of our function:

*

*f(x) = 1 for all x smaller than 1 or greater than 2;

*f(x) = 100 for x = 1.5;

*f(x) is undefined anywhere else.

I have replaced the bullets with a numbered list, because we actually only need to test one x value for each case to show whether or not a δ exists which satisfies our ϵ.
Let x0=1.5 and ϵ=98.  Consider the following cases:

*

*Let x=0, then we have δ = |x−x0| = |0-1.5| = 1.5, which is greater than 0, but  |f(x)−f(x0)| = |1-100| = 99, which is not less than our ϵ, so this cannot be a valid case

*Let x=1.5, then we have δ = |x−x0| = |1.5-1.5| = 0, so δ is not greater than 0.  There are no other x values applicable to this case, so this cannot be a valid case.

*Let x=1.25, then we have δ = |x−x0| = |1.25-1.5| = 0.25, which is greater than 0, but f(x) is undefined, so this cannot be a valid case.

Because we have checked all possible cases, there does not exist a positive number δ such that |f(x)−f(x0)| < ϵ, for some positive ϵ (i.e. ϵ=98)
