Slightly changing the formal definition of continuity of $f: \mathbb{R} \to \mathbb{R}$?

Your proposed definition would force us to accept as "continuous" functions that are nowhere continuous. An example is

$$f(x) = \begin{cases} 0 & \text{ if $x$ is rational} \\ 1 & \text{ if $x$ is irrational} \end{cases}$$

Pick your favourite $\delta > 0$; we can now choose $\epsilon = 2$. Clearly, for any $x_0$ we have that if $|x-x_0| < \delta$ then $|f(x) - f(x_0)| < \epsilon$.


Your confusion seems to lie in trying to translate the sentence "if two points are close, then their images under $f$ are close" into a formal mathematical statement. Since the sentence mentions the points in the domain first, it seems like the mathematical statement should also "start in the domain".

I'd like to suggest that a better gloss on the meaning of continuity is "if two points are close enough, then their images under $f$ are close". This is because for a continuous function like $f(x) = 100x$, points have to be much closer in the domain to guarantee a level of closeness in the range. That is, to guarantee that $|f(x) - f(y)| < \frac{1}{2}$, we must have $|x-y| < \frac{1}{200}$.

Now to translate. The issue is that "close" is a vague word. Formally, when we say "close", we need to specify how close. So let's change the first instance of "close" to "$\delta$-close" and express it as $|x-y|<\delta$ and change the second instance of "close" to "$\epsilon$-close" and express it as $|f(x) - f(y)|<\epsilon$. Then the sentence becomes $$|x-y|<\delta \implies |f(x) - f(y)|<\epsilon.$$

But we don't want the definition of continuity to depend on $\delta$ and $\epsilon$ - we want to quantify them out. How close should $f(x)$ and $f(y)$ be? Well, as close as we want. So we need to quantify over all $\epsilon > 0$. How close should $x$ and $y$ be? Well, close enough: as close as they need to be to satisfy the conclusion $|f(x) - f(y)|<\epsilon$. This makes it clear that the $\delta$ depends on the $\epsilon$.


The definition says that $$\forall\epsilon\gt0\exists\delta\text{ such that } |x-x_0|\lt\delta\implies|f(x)-f(x_0)|\lt\epsilon$$

The version you mention says that

$$\forall\delta\gt0\exists\epsilon\text{ such that } |x-x_0|\lt\delta\implies|f(x)-f(x_0)|\lt\epsilon$$

The two are not the same. The first says that you can get $f(x)$ as close to $f(x_0)$ as you wish by getting $x$ sufficiently close to $x_0$. The second says that however close(or far)$x$ may beto $x_0$, you can find a positive number greater than $|f(x)-f(x_0)|$, which is always true, when $f(x)$ and $f(x_0)$ are finite.

For example, suppose you have the function $$f(x)=\begin{cases}0&x=0\\1&\text{ else}\end{cases}$$

You can prove the function to be continuous at $x=0$ using the second definition. For any $\delta$, if you take $\epsilon\gt1$, the statement holds.