Finite modification of the identity on the real line (source code)

= Finite modification of the identity on the real line
{title2=$|\{x:f(x)\ne x\}|<\infty$}

A <finite modification of the identity on the real line> is a <function> $f:\mathbb R\to\mathbb R$ agreeing with the <identity map> outside a <finite set>. For example, changing only $f(0)$ to $3$ gives such a <function>; both $0$ and $3$ then map to $3$, so a finite modification need not be a <bijection>.

Sorting the exceptional <set> gives a unique finite record of <ordered pairs> $(x,f(x))$. <Real-number pairing by separated digits> encodes every fixed-length record in $(0,1)$, and placing length-$n$ records in disjoint <intervals> $(n,n+1)$ gives an <injection> into the <real line>. Include the zero-length record for the unchanged <identity map>. Conversely, prescribing $f(0)=t$ and $f(x)=x$ for $x\ne0$ gives distinct <functions> for distinct <real numbers> $t$. The <Cantor-Schröder-Bernstein theorem> therefore shows that all such finite modifications have the same <cardinality> as the <real line>.