We get back to *real analysis *and ** continuity **in this post, to show the equivalence of two different definitions of continuity for real functions: the one based on

*sequences*and the one based on

*neighborhoods.*

Let \(f\) be a real function with domain \(D \subseteq \Bbb R\) and \(a \in D\).

**Definition 1 (continuity by sequences). We say that \(f\) is continuous in \(a\) if, for each sequence \((a_n)\) whose points lie in \(D\) and such that \((a_n)\to a\), we have that \((f(a_n))\to f(a)\).**

**Definition 2 (continuity by neighborhoods). The function \(f\) is continuous in \(a\) if for all \(\varepsilon > 0\) there is a \(\delta >0\) such that, if \(x \in D\) and \(|x-a|<\delta\), then \(|f(x)-f(a)|< \varepsilon\).**

Let us first show that continuity by neighborhoods implies continuity by sequences.

- Fix \(\varepsilon > 0\). Can you state that there is \(\delta >0\) such that \[|f(x)-f(a)|<\varepsilon\] provided that \(|x-a|< \delta\)?
- Consider a sequence \((a_n)\) that converges to \(a\), and whose elements all lie in \(D\). Its convergence implies that for large enough \(n\), say \(n>N_\delta\), we have \[|a_n-a|<\delta.\]
- Use 1. and 2. to show that, for \(n>N_\delta\),\[|f(a_n)-f(a)|<\varepsilon\] and conclude that \((f(a_n))\to f(a)\), as we needed to show.

On the other way around, suppose that continuity by neighborhoods **is not **satisfied.

- Show that not having continuity by neighborhoods is equivalent to the following.
**F****or some**\(\varepsilon> 0\) it must hold that**for all**\(\delta>0\) there exists an \(x\in D\) with \(|x-a|<\delta\) such that \(|f(x)-f(a)|>\varepsilon\). - For each \(n=1,2,\dots\) choose a number \(a_n\) such that \(|a_n-a|<\frac1n\) and \(|f(a_n) – f(a)| > \varepsilon\), which can be done according to 1.
- Show that the sequence \(a_n\)
**converges to \(a\)**. - With an argument similar to that in 1., show that that the sequence \((f(a_n))\)
**does not converge to \(f(a)\)**and conclude that this contradicts continuity by sequences.

Thus continuity by sequences implies continuity by neighborhoods, as you just proved by contradiction.

You can try to apply these definitions to the function \(f : [0\ \ +\infty) \to \Bbb R\) that preserves only the digits occupying an even position in the decimal representation of its input. For example \[f({\bf 5}8{\bf 3}1{\bf 2}.7{\bf 9}5{\bf 1})=532.91.\]

This rather odd function surprisingly shows very neat properties.

- Using continuity by sequences, show that that \(f\) is right-continuous in \(0\).
- Again with continuity by sequences, show that \(f\)
**is not**continuous at numbers whose least significant digit occupies an**odd position**. (Note, however, that at those points \(f\) is indeed right-continuous.) - Generalize 1.; using definition of continuity based on neighborhoods and contradiction, show that \(f\)
**is**continuous at all numbers whose decimal representation has the least significant digit in an**even position**. - Finally show, with continuity by neighborhoods, that \(f\)
**is**continuous at all numbers having**infinite decimal representation**(for example, at all irrational numbers).

So, \(f\) is right-continuous everywhere and continous *almost everywhere*. Incidentally, note that this makes \(f\) a Riemann integrable function. Can you compute \[\int_0^1 f(x) dx\ ?\]