# Real numbers/Continuous functions/Motivation/Introduction/Section

We denote the distance between two real numbers $x$ and $x'$ by $d{\left(x,x'\right)}:=\vert {x-x'}\vert$. For a given function
    $f\colon \mathbb {R} \longrightarrow \mathbb {R} ,$
one may ask whether it is possible to control the distance in the image (the target) by controlling the distance in the domain. Let $x\in \mathbb {R}$ and let $y=f(x)$ be its image. One would like that for points $x'$ which are close to $x$, also their image points $f(x')$ are close to $f(x)$. Already linear functions with different slopes show that the measure for being close in the image and in the domain can not be the same. A reasonable question is whether for any desired exactness in the image there exists at all an exactness in the domain which ensures that the values of the function are lying inside the desired exactness. To make this intuitive idea more precise, let $\epsilon >0$ be given. This $\epsilon$ represents an accuracy for the target. The question is whether one can find a $\delta >0$ (representing an accuracy for the domain) such that for all $x'$ fulfilling $d{\left(x,x'\right)}\leq \delta$, also the relation $d{\left(f(x),f(x')\right)}\leq \epsilon$ holds. This idea leads to the concept of a continuous function.

## Definition

Let $D\subseteq \mathbb {R}$ be a subset,
    $f\colon D\longrightarrow \mathbb {R}$
a function, and $x\in D$ a point. We say that $f$ is continuous in the point $x$, if for every $\epsilon >0$, there exists a $\delta >0$, such that for all $x'\in D$ fulfilling $\vert {x-x'}\vert \leq \delta$, the estimate $\vert {f(x)-f(x')}\vert \leq \epsilon$ holds. We say that $f$ continuous, if it is continuous in every point
$x\in D$
$D$ stands for the set of definition of the function. Typically, $D$ is just $\mathbb {R}$, or an interval, or $\mathbb {R}$ with finitely many points removed. Instead of working with the real numbers $\epsilon$ and $\delta$, one might also work just with the unit fractions ${\frac {1}{n}}$ and ${\frac {1}{m}}$.

## Example

A constant function
    $\mathbb {R} \longrightarrow \mathbb {R} ,x\longmapsto c,$
is continuous. For every given $\epsilon$, one can choose an arbitrary $\delta$, since
    $d(f(x),f(x'))=d(c,c)=0\leq \epsilon \,$
holds anyway.
The identity
    $\mathbb {R} \longrightarrow \mathbb {R} ,x\longmapsto x,$
is also continuous. For every given $\epsilon$, one can take $\delta =\epsilon$, yielding the tautology: If
    $d(x,x')\leq \delta =\epsilon \,,$
then
    $d(f(x),f(x'))=d(x,x')\leq \epsilon \,$
holds.

## Example

We consider the function
    $f\colon \mathbb {R} \longrightarrow \mathbb {R} ,$
given by
    $f(x)={\begin{cases}0,{\text{ if }}x<0\,,\\1,{\text{ if }}x\geq 0\,.\end{cases}}\,$
This function is not continuous in $0$. For $\epsilon ={\frac {1}{2}}$ and every positive $\delta$, there exists a negative number $x'$ such that $d(0,x')=\vert {x'}\vert \leq \delta$. But for such a number we have $d(f(0),f(x'))=d(1,0)=1\not \leq {\frac {1}{2}}$.
The following statement relates continuity to convergent sequences.

## Lemma

Let $D\subseteq \mathbb {R}$ be a subset,
    $f\colon D\longrightarrow \mathbb {R}$
a function and $x\in D$
* $f$ is continuous in the point $x$.
* For every convergent sequence ${\left(x_{n}\right)}_{n\in \mathbb {N} }$ in $D$ with $\lim _{n\rightarrow \infty }x_{n}=x$, also the image sequence ${\left(f(x_{n})\right)}_{n\in \mathbb {N} }$ is convergent with limit $f(x)$.

### Proof

Suppose that (1) is fulfilled and let ${\left(x_{n}\right)}_{n\in \mathbb {N} }$ be a sequence in $D$ converging to $x$. We have to show that
    $\lim _{n\rightarrow \infty }f(x_{n})=f(x)\,$
holds. To show this, let $\epsilon >0$ be given. Due to (1), there exists a $\delta >0$ fulfilling the estimation property (from the definition of continuity) and because of the convergence of ${\left(x_{n}\right)}_{n\in \mathbb {N} }$ to $x$ there exists a natural number $n_{0}$ such that for all $n\geq n_{0}$ the estimate
    $d(x_{n},x)\leq \delta \,$
holds. By the choice of $\delta$ we have
    $d(f(x_{n}),f(x))\leq \epsilon {\text{ for all }}n\geq n_{0},$
so that the image sequence converges to $f(x)$.
Suppose now that (2) is fulfilled. We assume that $f$ is not continuous. Then there exists an $\epsilon >0$ such that for all $\delta >0$ there exist elements $z\in D$ such that their distance to $x$ is at most $\delta$, but such that the distance of their value $f(z)$to $f(x)$ is larger than $\epsilon$. This holds in particular for every $\delta =1/n$, $n\in \mathbb {N} _{+}$. This means that for every natural number $n\in \mathbb {N} _{+}$, there exists a $x_{n}\in D$ with
    $d(x_{n},x)\leq {\frac {1}{n}}{\text{ and with }}d(f(x_{n}),f(x))>\epsilon .$
This sequence ${\left(x_{n}\right)}_{n\in \mathbb {N} }$ converges to $x$, but the image sequence does not converge to $f(x)$, since the distance of its members to $f(x)$ is always at least $\epsilon$. This contradicts condition (2).
$\Box$