\documentclass{rae}%\usepackage{amstex}
\usepackage{amsmath}\usepackage{amssymb}

\author{Krzysztof Ciesielski%
\thanks{
The work of the first and the third author
was partially supported by NSF Cooperative
Research Grant INT-9600548 with its Polish part
financed by Polish Academy of Science PAN. The results were obtained
during a visit of the third author at
Columbus State University and
West Virginia University.
\endgraf % \hspace*{1pc}
The first author
was also supported by 1996/97 West Virginia
University Senate Research Grant.\endgraf 
Papers authored or co-authored by a Contributing Editor are managed 
by a Managing Editor or one of the other Contributing Editors.},
Department of Mathematics, West Virginia University,
Morgantown, WV 26506-6310, USA
(KCies@wvnvms.wvnet.edu)\\
Richard G. Gibson, Department of Mathematics, Columbus
 State University,
Columbus, GA 31907, USA
(Gibson\_Richard\at colstate.edu)\\
Tomasz Natkaniec, Department of Mathematics, Gda{\'n}sk
University, Wita Stwosza 57, 80-952 Gda{\'n}sk, Poland
(mattn\at ksinet.univ.gda.pl)
}
\title{$\kappa$-to-1 Darboux-like functions}
\date{}
\MathReviews{Primary 26A15.}
\keywords{$k$-to-1 functions, Darboux functions,
perfect road, intermediate value property.}








\newcommand{\at}{@}

\newcommand{\dist}{{\rm dist}}
\newcommand{\bd}{{\rm bd}}
\newcommand{\eee}{\varepsilon}
\newcommand{\res}{\upharpoonright}
\newcommand{\propsub}{\subsetneqq}
\def\dom{{\rm dom}}
\def\proof{\noindent{\sc Proof. }}
\def\qed{\hfill$\Box$}
\def\qed{\hfill\vrule height6pt width6pt depth1pt%\medskip
}
\def\la{\langle}
\def\ra{\rangle}
\def\implies{\longrightarrow}

\newcommand{\J}{{\cal J}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{question}{Question}[section]
\newtheorem{problem}{Problem}[section]
\newtheorem{example}{Example}[section]
\newtheorem{definition}{Definition}
\newtheorem{conjecture}{Conjecture}
\newtheorem{remark}{Remark}[section]
\newcommand{\real}{{\mathbb R}}
\newcommand{\mathR}{\real}
\newcommand{\rational}{{\mathbb Q}}
\newcommand{\integer}{{\mathbb Z}}
\newcommand{\const}{{\rm Const}}
\newcommand{\sz}{{\rm SZ}}
\def\continuum{{\frak c}}
\def\co{\continuum}
\def\cuum{\continuum}
\newcommand{\INT}{{\rm int}}


\begin{document}

\maketitle

\begin{abstract}
We examine the existence of
$\kappa$-to-1 functions $f\colon\real\to\real$ in the class
of continuous functions, Darboux functions, functions
with perfect road, and functions with Cantor intermediate
value properties. In this setting $\kappa$ stands for a cardinal
number
(finite or infinite).
We also consider different variations on this theme.

\end{abstract}

\section{Continuous and Darboux functions}

We will use the standard terminology and notation as
in~\cite{Ci:book}.
In particular, ordinal numbers will be identified with the set of
their
predecessors and cardinal numbers with the initial ordinals.
Thus the first infinite cardinal $\omega$ is identified
with the set of natural numbers. We will reserve the
letters $k$ and $n$ for the natural numbers.
The cardinality of the set $\real$ of real numbers is denoted by
$\co$. Symbol $|X|$ will stand for the cardinality of a set $X$.
For a cardinal $\kappa>0$ we say that a function $f\colon X\to Y$
is {\em $\kappa$-to-1\/} if $\left|f^{-1}(y)\right|=\kappa$
for every $y\in Y$.
Similarly we define {\em $\leq$$\kappa$-to-1\/} and
{\em $<$$\kappa$-to-1\/}
functions. We will use terms
{\em countable-to-1\/} and {\em finite-to-1\/} for functions that are
$\leq$$\omega$-to-1 and $<$$\omega$-to-1, respectively.
A function $f\colon\real\to\real$
is {\em Darboux\/} if it has the intermediate value property,
that is, if the image $f[J]$ of every connected subset $J$ of
the domain (i.e., an interval) is connected in the range.
The last property serves also as a general definition
of a Darboux function from a topological space $X$
into a topological space~$Y$.

The notion of an n-to-1 function was introduced by O. G. Harrold, Jr.
in 1939 in the paper \cite{OGH} where he showed that there does not
exist
a continuous  2-to-1  function carrying an arc into an arc or a
circle.
Following this paper a sequence of
papers appeared in the early 1940's which studied the existence of
n-to-1 continuous functions defined on various classes of continua,
\cite{PC}, \cite{PG}, and \cite{JHR}. More recent relevant papers were
published in the 1980's and among those are
\cite{JH}, \cite{KKK}, and~\cite{NW}.

In 1922 D. C. Gillespie stated in the Bulletin of the American Math.
Soc. \cite{DG} that a function having the intermediate value property
will
be continuous unless the set of values it assumes an infinite number
of
times fills at least one interval.
This fact is well-known and follows from the following proposition.

\begin{proposition}\label{prop1.1}
{\rm \cite[thm~5.2]{BC}}
If $f\colon\real\to\real$ is Darboux and all level sets
$f^{-1}(y)$ of $f$ are closed then $f$ is continuous.
\end{proposition}

As a consequence of those results we see that the question
\begin{equation}\label{eq1}
\text{{\it For which $k<\omega$ does there exist a $k$-to-1 Darboux
function?}}
\end{equation}
is equivalent to the following
\begin{equation}\label{eq2}
\text{\it For which $k<\omega$ does there exist a $k$-to-1 continuous
function?
}
\end{equation}

Our first result is the following proposition, that
is probably known.

\begin{proposition}\label{prop1}
The following conditions are equivalent for $n<\omega$:
\begin{enumerate}
\item[{\rm (i)}]  there exists a continuous function
$f\colon\real\to\real$ that is $n$-to-1;
\item[{\rm (ii)}]  there exist a set $Y\subset\real$ and a continuous
function $f\colon\real\to Y$ that is $n$-to-1;
\item[{\rm (iii)}]  $n$ is odd.
\end{enumerate}
\end{proposition}

\proof
The implication (i)$\Rightarrow$(ii) is obvious.

(ii)$\Rightarrow$(iii) Suppose that
$f\colon\real\to Y$
is a continuous $n$-to-1 function and, by way of
contradiction, assume that
$n$ is even, say $n=2k$. Clearly $n>0$.
Fix a
$y_{0}\in Y$ and the points
$x_{1}<x_{2}<\cdots<x_{n}$ such
that $f(x_{i})=y_{0}$ for $i=1,2,\ldots ,n$.

For each $m=1,\ldots,n-1$ let $I_m=[x_m,x_{m+1}]$. So, we have
a partition of $[x_1,x_n]$ onto $2k-1$ intervals $I_m$ such that
for each $m$ either $f|I_m\geq y_0$ or $f|I_m\leq y_0$. We will
suppose
that the set $M=\{m\colon f|I_m\geq y_0\}$ has at least $k$
elements, since the case when $|\{m\colon f|I_m\leq y_0\}|\geq k$ is
essentially the same.
Put $h_m=\max f|I_m$ and $h=\min\{ h_m\colon m\in M\}$.
Then $h>y_0$ and for each $y\in(y_0,h)$ and $m\in M$ the set
$f^{-1}(y)\cap I_m$ has at least $2$ points. So
\begin{equation}\label{eq3}
\!\!\!\!\!\! \!\!\!\!\!\!
\text{$(x_1,x_n)\cap f^{-1}(y)$ has at least $2|M|\geq 2k$
points for every $y\in(y_0,h)$.}
\end{equation}
Since $|f^{-1}(y)|=n=2k$ for every $y$ we conclude that $M$
has exactly $k$ elements. Moreover, (\ref{eq3}) implies that
\[
\{x\colon f(x)>y_0\}\subset\bigcup_{m\in M}I_m\subset[x_1,x_n].
\]
Thus, if $y_m=\max f|[x_1,x_n]$ then
all $n$ elements of $f^{-1}(y_m)$ belong to $(x_1,x_n)$
and are local maxima. Therefore, for every $y<y_m$
which is close enough to $y_m$ the set $f^{-1}(y)$
has at least $2n$ elements, a contradiction.

(iii)$\Rightarrow$(i) Assume that $n$ is odd.
If $n=1$ we put $f(x)=x$. For $n>1$ let $f$ be the
function defined by
the formula
\[
f(x)=x+n\ \dist(x,\integer)
\]
 where $\dist(x,\integer)$ denotes the distance between $x$ and
 the set $\integer$ of integers.
It is easy to observe that
$f^{-1}(y)$ has $n$ elements for each $y\in\real$.
\qed



\begin{corollary}\label{cor1}
The following conditions are equivalent:
\begin{enumerate}
\item[{\rm (i)}]  there exists a continuous $\kappa$-to-1 function
$f\colon\real\to\real$;
\item[{\rm (ii)}]  there exist a set $Y\subset\real$ and a continuous
function $f\colon\real\to Y$ that is $\kappa$-to-1;
\item[{\rm (iii)}]  $\kappa\in\{\co,\omega\}\cup\{2k+1\colon
k<\omega\}$.
\end{enumerate}
\end{corollary}

\proof
 (i)$\Rightarrow$(ii) is obvious.

 (ii)$\Rightarrow$(iii)
  Since $f^{-1}(y)$
is a closed subset of $\real$ for any continuous function $f$ we see
that
$\kappa\in\{\co,\omega\}\cup\omega$. But if $\kappa\in\omega$
then $\kappa$ cannot be an even number by Proposition~\ref{prop1}.

(iii)$\Rightarrow$(i) For an odd number $\kappa\in\omega$
the existence of $f$ follows from Proposition~\ref{prop1}.
For $\kappa=\omega$ it is enough to take $f(x)=x \sin x$.
So assume that $\kappa=\co$ and
let $f_0\colon[0,1]\to[0,1]$ be such that $f_0(0)=0$, $f_0(1)=1$, and
$|f_0^{- 1}(y)|=\co$ for each $y\in [0,1]$.
An example of such a function is given
in Bruckner's book~\cite[pp. 148--150]{AB}.
Then $f\colon\real\to\real$ defined by
$f(x)=E(x)+f_0(x-E(x))$ is continuous and $\co$-to-1,
where $E(x)$ denotes the integer part of $x$.
\qed

\medskip

Corollary~\ref{cor1} gives the full answer for the questions
(\ref{eq1})
and (\ref{eq2}). However, the following more general problem
might be also of interest.

\begin{problem}\label{prob1}
For which maps
$j\colon\real\to\{\co,\omega\}\cup\omega$ does there
exist a continuous function $f_j\colon\real\to\real$
such that
\[
\left|f_{j}^{-1}(y)\right|=j(y)\ \text{ for every $y\in\real$?}
\]
\end{problem}
To investigate this problem we will use the following terminology.
For a map $j\colon\real\to\co\cup\{\co\}$ we say that a function
$f\colon X\to\real$ is {\em $j$-to-1\/} provided $|f^{-1}(y)|=|j(y)|$
for every $y\in\real$.
Corollary~\ref{cor1} answers the above question
for constant maps $j$. Some light on the general
version of Problem~\ref{prob1} is shed by the following fact.

\begin{proposition}\label{prop2}
Let $f\colon\real\to\real$ be
a Darboux function, $y\in\real$, and
$\kappa=\left|f^{-1}(y)\right|$. If $\kappa<\omega$ and
$B_\kappa=\{z\in\real\colon \left|f^{-1}(z)\right|\geq\kappa\}$
then there exists an $\eee>0$ such that either
$(y-\eee,y]\subset B_\kappa$ or $[y,y+\eee)\subset B_\kappa$.
In particular, $B_\kappa$ is an $F_\sigma$-set for each
$\kappa<\omega$.
\end{proposition}

\proof
 Let $X=f^{-1}(y)$ and choose
a positive $\delta$ such that
the intervals $\{[x-\delta,x+\delta]\}_{x\in X}$ are pairwise
disjoint.
Let $X^*=\bigcup_{x\in X}\{x-\delta,x+\delta\}$
and put $X^+=\{x\in X^*\colon f(x)>y\}$ and
$X^-=\{x\in X^*\colon f(x)<y\}$. Then at least one of the sets $X^+$
and $X^-$ has at least $\kappa$ elements.
Assume that $|X^+|\geq\kappa$ and let $y_1=\min\{f(x)\colon x\in
X^+\}$.
Then $y_1>y$ and $[y,y_1]\subset B_\kappa$.
The case for $|X^-|\geq\kappa$ is similar.

Now, the set $B_\kappa$ is $F_\sigma$ since it is a countable union
of nontrivial intervals: the components of $B_\kappa$. \qed

 For continuous finite-to-1 functions we have a full answer to
 Problem~\ref{prob1}. It is a consequence of the following
 improvement of Proposition~\ref{prop2}.

\begin{proposition}\label{prop2a}
Let $f$ be a finite-to-1 continuous function from $\real$
onto $\real$ and for $k<\omega$ let
$B_k=\{z\in\real\colon\left|f^{-1}(z)\right|\geq k\}$.
 Then for all $k,l\in\omega$ with $l\le 2k+1$ and
 $y\in\real\setminus \INT B_l$ with $k=\left|f^{-1}(y)\right|$
 there exists an $\eee>0$ such that either $(y-\eee,y)\subset
 B_{t}$ or $(y,y+\eee)\subset B_{t}$, where $t=2k-l+1$ if $l$ is
 even and $t=2k-l+2$ if $l$ is odd.
\end{proposition}
\proof
Suppose that $j(y)=\left|f^{-1}(y)\right|=k$ and
\begin{equation}\label{ee}
\text{there exists a sequence $y_n\searrow y$ with $j(y_n)\le l-1$.  }
\end{equation}
Note that since $f$ is finite-to-1 and onto $\real$ we have either
\[
\lim_{x\to -\infty}f(x)= -\infty\ \text{ and } \
\lim_{x\to \infty}f(x)= \infty
\]
or
\[
\lim_{x\to -\infty}f(x)= \infty\ \text{ and } \
\lim_{x\to \infty}f(x)= -\infty.
\]

Now $f^{-1}(y)$ partitions $\real$ into $k+1$
open intervals $J_0,\ldots,J_{k}$
of which $k-1$,
say $J_1,\ldots,J_{k-1}$,
are bounded. Also, for every $j\in\{0,\ldots, k\}$ we have either
$f|J_j>y$ or $f|J_j<y$.
 Moreover, by the above limit consideration, either $f|J_0>y$ or
 $f|J_k>y$. Consequently, by the condition~(\ref{ee}), the set
 $M\subset\{ 1,\ldots, k-1\}$ of all $i$ for which $f|J_i>y$ has
 at most ${\rm E}((l-2)/2)$ elements. Thus $N=\{ 1, \ldots,
 k-1\}\setminus M$ has at least $k-1-{\rm E}((l-2)/2)$ elements.
 Let $\eee>0$ be such that $\min f|J_i<y-\eee$ for every $i\in
 N$. Then every value $z$ from $(y-\eee,y)$ is taken at least
 twice on each interval $J_i$ with $i\in N$. Moreover, such a
 value is in at least of unbounded intervals by the above limit
 consideration.  Thus, $|f^{-1}(z)|\geq 2k-2-2{\rm
 E}((l-2)/2)+1$. Finally, note that $2k-2-2{\rm E}((l-2)/2)+1$ is
 equal to $2k-l+1$ if $l$ is even and it is equal to $2k-l+2$ if
 $l$ is odd.  \qed

\begin{corollary}\label{c1}
Let $f$ be a finite-to-1 continuous function from $\real$
onto $\real$.
Then for every even $k\in\omega$ and $y\in\real$ with
$k=\left|f^{-1}(y)\right|$ (that is $y\in B_k\setminus B_{k+1}$)
there exists an $\eee>0$ such that either
$(y-\eee,y)\subset B_{k+1}$ or $(y,y+\eee)\subset B_{k+1}$.

In particular, for every $n\in\omega$ the set $B_{2n}\setminus
 B_{2n+1}$ has an empty interior.
\end{corollary}
\proof
 This is a consequence of Proposition~\ref{prop2a} with $l=k+1$.
 Indeed, suppose that $k$ is even. For every $y\in B_k\setminus
 B_{k+1}$, either $y\in \INT(B_{k+1})$ or $y$ is an end-point of
 some interval contained in $B_{k+1}$.
\qed

\begin{corollary}\label{c2}
Let $f$ be a finite-to-1 continuous function from $\real$
onto $\real$.
If $|f^{-1}(y)|=2k+1$ and $y\notin\INT B_{2k+1}$, then
there exists an $\eee>0$ such that either
$(y-\eee,y)\subset B_{2k+3}$ or $(y,y+\eee)\subset B_{2k+3}$.
\end{corollary}
\proof
 Consider Proposition~\ref{prop2a} with $l=2k+1$.\qed


\begin{theorem}\label{Th:Caract}
 Let $j\colon\real\to\{1,2,3,\ldots\}$. The following conditions
 are equivalent.
\begin{enumerate}
\item[{\rm (a)}]  There exists a continuous $j$-to-1 function
$f\colon\real\to\real$.

\item[{\rm (b)}] For every $k\in\omega$
  \begin{enumerate}
  \item[{\rm (i)}]
 $C_k=j^{-1}(\{k,k+1,k+2,\ldots\})$ is a (possibly empty) union of pairwise
 disjoint non-trivial intervals,
 \item[{\rm (ii)}] $j^{-1}(2k)$
 has an empty interior, and
 \item[{\rm (iii)}] if $y\in
 j^{-1}(2k+1)\setminus \INT C_{2k+1}$ then $y$ is an end-point of
 a component of $\INT C_{2k+3}$.
  \end{enumerate}
\end{enumerate}
\end{theorem}

\proof
 (a)$\Rightarrow$(b) Clearly
 $j^{-1}(\{k,k+1,\ldots\})=\{z\in\real\colon\left|f^{-1}(z)\right|
 \geq k\}=B_k$ and, by Proposition~\ref{prop2}, the component
 intervals of $B_k$ are the non-trivial intervals, proving (i).
 Conditions (ii) and (iii) follow immediately from
 Corollaries~\ref{c1} and \ref{c2}, respectively.

(b)$\Rightarrow$(a) Let
\begin{itemize}
\item
$\J_k$ be the family of all components of $C_{2k+1}$,
 $\J_k=\{ J_{k,1}, J_{k,2},\ldots\}$;
\item
$D_k=\INT C_{2k+1}=\bigcup\{\INT J\colon J\in\J_k\}$;
\item
$E$ be the set of all endpoints
of intervals belonging to some $\J_k$;
\item
$E_k=\bigcup\{ \bd(J)\colon J\in\J_k\}$.
\end{itemize}

Note that $E$ is countable, $E=\bigcup_k E_k$, and
 $C_{2k}\subset D_k\cup E_k$ for each positive integer $k$.
The desired function $f$ will be 
defined as a limit of functions $f_k$ from
 $\real$ onto $\real$.
 We start with $f_0$ being the identity function. Assume that
 $f_k$ is defined.  To construct $f_{k+1}$ we take an arbitrary
 interval $J_{k+1,i}$ from $\J_{k+1}$ and represent
 $\hat{J}=J_{k+1,i}\cup (\bd J_{k+1,i}\cap C_{2k-1})$
as a union
 of closed intervals $J^1_{k+1,i},J^2_{k+1,i},J^3_{k+1,i},\ldots$
 with disjoint interiors.  We will assume also that
\begin{enumerate}
\item[($\alpha$)]
the length of $J^m_{k+1,i}$ is less than $2^{-k-1}$;
\item[($\beta$)]
the endpoints of the intervals $J^m_{k+1,i}$ are disjoint from
 $E$, with the exception of the endpoints of $\hat{J}$, if they
 belong to $J^m_{k+1,i}$;
\item[($\gamma$)]
 if $J_{k+1,i}^n\cap J_{k,j}^m\neq\emptyset$ then
 $J^n_{k+1,i}\subset J_{k,j}^m$;
\item[($\delta$)]
 for every $m$ there is an interval $I^m_{k+1,i}\subset
 f_{k}^{-1}(J^m_{k+1,i})$ such that $f_k|I^m_{k+1,i}$ is linear,
 $f_k[I^m_{k+1,i}]=J^m_{k+1,i}$, and $I^m_{k+1,i}\subset
 I^n_{k,j}$ whenever $I^m_{k+1,i}\cap I^n_{k,j}\neq\emptyset$.
\end{enumerate}

Also, we can order the family of all $J^m_{k+1,i}$ in the type of
 $\integer$, if $\hat{J}$ is open, in the type of $\omega$ (or
 $\omega^*$) if $\hat{J}$ contains only left (right) endpoint,
 and in a finite type, when $\hat{J}$ contains both endpoints.

The function $f_{k+1}$ is obtained by modifying $f_k$ on every
 interval $I^m_{k+1,i}$ The modification is obtained by replacing
 a $f_k|I^m_{k+1,i}$ by a function with graph of shape of letter
 N. (Or its mirror image.)

By ($\alpha$), the sequence $(f_k)_k$ is uniformly convergent to
 a continuous function $f\colon\real\to\real$.

 Observe that for each $k\in\omega$ and $y\in\real$ we have
 \begin{equation}\label{e1}
 |f^{-1}_k(y)|=\left\{ \begin{array}{ll}
 |f^{-1}_{k-1}(y)|+2 & \mbox{if $y\in D_k$;}\\
 |f^{-1}_{k-1}(y)|+1 & \mbox{if $y\in E_k\cap C_{2k-1}$;}\\
  |f^{-1}_{k-1}(y)| & \mbox{otherwise.}
  \end{array}\right.
  \end{equation}
  Thus,  we easily obtain (by induction) the equations
   \begin{equation}\label{e2}
 |f^{-1}_k(y)|=\left\{ \begin{array}{ll}
 2k+1 & \mbox{if $y\in D_k$;}\\
 2k & \mbox{if $y\in E_k\cap C_{2k}$;}\\
 2k-1 & \mbox{if $y\in E_k\cap (C_{2k-1}\setminus C_{2k}$);}\\
  |f^{-1}_{k-1}(y)| & \mbox{otherwise.}
  \end{array}\right.
  \end{equation}
Note also the following properties of the sequence $(f_k)_k$.
\begin{equation}\label{e3}
 \text{ If $k<n$ and $y\in\real$ then $|f_k^{-1}(y)|\leq
 |f_n^{-1}(y)|$.}
\end{equation}
%\begin{equation}\label{e4}
% \text{If $x\in\bigcup_m\bigcup_i I^m_{k,i}$ then $f_k(x)\in
% C_{2k-1}$.}
%\end{equation}
\begin{equation}\label{e5}
 \text{If $x\not\in\bigcup_m\bigcup_i I^m_{k,i}$ then
 $f_k(x)=f_{k-1}(x)$.}
\end{equation}

The statement (\ref{e3})
and condition ($\delta$) imply
that for each $x\in\real$ there is
a $k_0$ with $x\in \bigcup_m\bigcup_i I^m_{k_0,i} \setminus
\bigcup_{k>k_0}\bigcup_m\bigcup_i I^m_{k,i}$.
Thus, by
(\ref{e5}),
\begin{equation}\label{e6}
 \text{ for each $x\in\real$ there is $k_0\in\omega$ such that
 $f_k(x)=f_{k_0}(x)$ for $k>k_0$.}
\end{equation}
Moreover,
\begin{equation}\label{e7}
 \text{ if $y\in \bigcup_m\bigcup_i J^m_{k_0,i} \setminus
 \bigcup_{k>k_0}\bigcup_m\bigcup_i J^m_{k,i}$ then
 $f^{-1}(y)=f^{-1}_{k_0}(y)$,}
\end{equation}
 so $f$ is finite-to-1. We will verify that $f$ is $j$-to-1.
 Assume that $y\in C_k$ and consider two cases. If $k$ is
odd, say $k=2k_0+1$ then, by (\ref{e2}),
$|f^{-1}_{k_0+1}(y)|\geq 2k_0+1$, and, by (\ref{e3}),
$|f^{-1}_k(y)|\geq 2k_0+1$ for all
$k>k_0$ so, by (\ref{e7}), $|f^{-1}(y)|\geq 2k_0+1$.
Similarly, if $k$ is
even, say
 $k=2k_0$, then $|f^{-1}_{k_0}(y)|\geq 2k_0$, so $|f^{-1}(y)|\geq
 2k_0$.
Therefore,
\begin{equation}\label{e8}
 (\forall k\in\omega)\;\;\; C_k\subset\{ y\in\real\colon
 |f^{-1}(y)|\geq k\}.
\end{equation}
 Now suppose that $y\not\in C_k$. Then for $k_0={\rm
 E}(\frac{k}{2})$ we have $|f^{-1}_{k_0}(y)|<2k_0\leq k$ and
 $y\not\in\bigcup_m\bigcup_i J^m_{k_0,i}$. Thus (\ref{e7})
 implies $|f^{-1}(y)|=|f^{-1}_{k_0}(y)|<k$. Hence
\begin{equation}\label{e9}
 (\forall k\in\omega)\;\;\; \{ y\in\real\colon |f^{-1}(y)|\geq
 k\} \subset C_k.
\end{equation}
Finally, by (\ref{e8}) and (\ref{e9}) we obtain the statement
\begin{equation*}
 (\forall k\in\omega)\;\;\; C_k=\{ y\in\real\colon
 |f^{-1}(y)|\geq k\}.
\end{equation*}
Thus $f$ is $j$-to-1.
\qed

\medskip
 Proposition~\ref{prop2} yields also the following result on
 Darboux countable-to-1 functions.

\begin{corollary}\label{corA}
If a Darboux function $f\colon\real\to\real$ is countable-to-1
and $j\colon\real\to\omega\cup\{\omega\}$ is defined by
$j(y)=|f^{-1}(y)|$ then $j$ is Borel measurable.
\end{corollary}

Note that in Corollary~\ref{corA} the assumption
that $f$ is countable-to-1 is essential.
This is even the case when $f$ is continuous, since
there is a continuous function $f\colon\real\to\real$
for which the set
$A_{\co}=\{y\colon|f^{-1}(y)|=\co\}$
is analytic non-Borel.
This follows from the fact
that the set
\[
A=\left\{x\in2^\omega\colon \left|{\rm pr}_1^{-1}(x)\right|=
 \co\right\}=
\varphi^{-1}(\{C\in K(2^\omega)\colon |C|>\omega\})
\]
is analytic non-Borel,
where $\varphi$ is a homeomorphism between
$2^\omega$ and the space $K(2^\omega)$ of all
 non-empty compact subsets of $2^\omega$ (with the Hausdorff
 metric) and
 ${\rm pr}_1$ is the projection of the graph of $\varphi$
onto the first coordinate.
 This is a consequence of a theorem of Hurewicz that the set
 $\{C\in K(2^\omega)\colon |C|>\omega\}$ is analytic non-Borel.
 (See \cite[thm~27.5, p.~210]{AK}. This fact was pointed out to
 the authors by S.~Solecki.) On the other hand for continuous $f$
 the sets
 $A_\kappa=\{z\in\real\colon\left|f^{-1}(z)\right|=\kappa\}$ are
 not too bad: they all are Borel for $\kappa\in\omega$ (this
 follows from Proposition~\ref{prop2}) and analytic for
 $\kappa=\co$. Indeed, 
from the Mazurkiewicz-Sierpi\'{n}ski theorem it follows
 that $A_\co$ is analytic. (See e.g. \cite[thm~3, p.
 496]{KK}, or
\cite[thm~29.19, p.~231]{AK}.) Consequently, the set $A_{\omega}$
 must be co-analytic.  Moreover, if $A_\co$ is non-Borel, then
 $A_{\omega}$ is non-Borel (so non-analytic), too.

Note that the results above follow also for Borel functions with
 the Darboux property.  Nothing good, though, can be said on the
 set $B_\co$ for a general Darboux function
 $f\colon\real\to\real$, as follows for the next proposition.

\begin{proposition}
For every set $Z\subset\real$ there exists a Darboux function
$f\colon\real\to\real$ with $Z=\{y\colon|f^{-1}(y)|=\co\}$.
\end{proposition}
\proof
 Let $\{A_\xi\colon\xi<\co\}$ be a partition of $\real$ into
 countable dense sets. Take an $h\colon\co\to\real$ such that
 $|h^{-1}(z)|=\co$ for $z\in Z$ and $|h^{-1}(z)|=1$ for $z\notin
 Z$. Define $f$ by putting $f(x)=h(\xi)$ for every $x\in A_\xi$
 and $\xi<\co$.  Then $f$ satisfies the conclusion.\qed

\medskip

Note also that the main part of Proposition~\ref{prop2}
is false for an infinite $\kappa$.

\begin{remark}
For $\kappa\in\{\omega,\co\}$ there exists
a continuous $\leq$$\kappa$-to-1 function
$f$ from $\real$ onto $\real$ for which
$B_\kappa=\{0\}$. Moreover, for every
countable set $B\subset\real$ there exists
a continuous function
$f$ from $\real$ onto $\real$ with the property that
$B=\{z\in\real\colon \left|f^{-1}(z)\right|=\co\}$.
\end{remark}

\proof
First assume that $\kappa=\omega$
and define $f$ by putting $f(0)=0$ and $f(x)=
x^2 \sin(x^{-1})$ for $x\neq 0$.
Then $f$ has the desired properties.

For $\kappa=\co$ first fix a perfect set $P$ and $a<b$ such that
 $P\subset[a,b]\subset(0,1)$ and let $g\colon[a,b]\to\real$ be
 such that $g(x)=\dist(x,P)$ is the distance between $x$ and $P$.
 Now it is easy to find an extension $f$ from $\real$ onto
 $\real$ for which $B_\co=\{0\}$.

To see the additional part let $B=\{b_n\colon n<\omega\}$
and define $f_0$ on a set $K=\bigcup_{n<\omega}(n+[a,b])$
by putting
\[
f_0(n+x)=b_n+g(x)\ \text{ for every $n<\omega$ and $x\in[a,b]$.}
\]
Extend $f_0$ to $f$ from $\real$ onto $\real$
such that $f$ is linear on each of the intervals $[n+b,(n+1)+a]$
and $f|(-\infty,a]$ is $\omega$-to-1 and onto $\real$.
It is easy to see that
$B=\{z\in\real\colon \left|f^{-1}(z)\right|=\co\}$.
\qed


\medskip

In the remainder of this section we consider the analogous
 problems for continuous functions from $\real^n$ or $[0,1]^n$
 into $\real$ and from $[0,1]$ into $\real$.  See \cite{PC},
\cite{OGH}, \cite{JH}, \cite{KKK}, \cite{NW} and
\cite{JHR}.
 J. H. Roberts in
\cite{JHR}, proved that there does not exist a continuous 2-to-1
 function defined on a closed 2-cell but left open the case for
 arbitrary n-cells.  Paul Civin in \cite{PC}, proved that there
 does not exist a continuous 2-to-1 function defined on a closed
 3-cell and stated that it can easily be demonstrated that a
 continuous function defined on $\real$ is not 2-to-1.  However,
 Civin noted that for $\real^n$ with $n$ equal to 2 or 3 this
 question is unknown.

We will start with the following easy remark.

\begin{proposition}\label{P3}
 Let $n>1$ and $X=\real^n$ or $X=[0,1]^n$.  If $f\colon
 X\to\real$ is Darboux then $f[X]$ is an interval and for every
 interior point $y$ of $f[X]$ the set $f^{-1}(y)$ has cardinality
 $\co$.
\end{proposition}

\proof
$f[X]$ is an interval since $X$ it is connected.
To see the other part take an interior point $y$ of $f[X]$.
Then the set $X\setminus f^{-1}(y)$ disconnects $X$
since $f[X\setminus f^{-1}(y)]\subset f[X]\setminus\{y\}$.
Thus $f^{-1}(y)$ has cardinality $\co$. \qed

\begin{remark}
Proposition~\ref{P3} remains true for an
arbitrary Darboux
function $f\colon X\to\real$
provided $X$ cannot be disconnected
by any set of cardinality less than $\co$.
\end{remark}

\begin{corollary}\label{cor22}
Let $n>1$ and $j\colon\real\to\co\cup\{\co\}$.
The following conditions are equivalent.
\begin{enumerate}
\item[{\rm (i)}]  There exists a continuous nonconstant $j$-to-1
function
$f\colon[0,1]^n\to\real$.

\item[{\rm (ii)}] There are $-\infty<a<b<\infty$
such that $j|(a,b)=\co$, $j|\real\setminus[a,b]=0$ and
$|j(a)|,|j(b)|\in\{\omega,\co\}\cup\omega\setminus\{0\}$.
\end{enumerate}
\end{corollary}

\proof
(i)$\Rightarrow$(ii)
 The range of $f$ is a closed interval $[a,b]$ by
 Proposition~\ref{P3} and compactness of $[0,1]^n$. Then, again
 by Proposition~\ref{P3}, we have also $j|(a,b)=\co$, while for
 $d\in\{a,b\}$ we have
 $|j(d)|\in\{\omega,\co\}\cup\omega\setminus\{ 0\}$ since
 $f^{-1}(d)$ is a non-empty closed subset of $\real^n$ and
 $|j(d)|=|f^{-1}(d)|$.

(ii)$\Rightarrow$(i)
 Let $A$ and $B$ be closed subsets of $[0,1]^n$ with distance
 $d>1$ and such that $|j(a)|=|A|$ and $|j(b)|=|B|$.  For
 $C\in\{A,B\}$ define $F_C=\{x\in[0,1]^n\colon\dist(x,C)\leq
.5\}$, where
$\dist(x,C)$ is the distance of $x$ to $C$. Then
$\dist(F_A,F_B)=d-1>0$.
For $x\in F_A$ define $g(x)=\dist(x,A)\in[0,.5]$
and for $x\in F_B$ put $g(x)=d-\dist(x,B)\in[d-.5,d]$.
Then, by the Tietze Extension Theorem, we can
extend $g$ continuously onto $[0,1]^n$ such that it assumes on
$[0,1]^n\setminus(F_B\cup F_B)$ only the values from $[.5,d-.5]$.
Now if $h$ is a homeomorphism between $[0,d]$ and $[a,b]$
then $f=h\circ g$ has the desired properties. \qed

\medskip

A slight modification of the above argument gives also
the following characterization.

\begin{corollary}\label{cor23}
Let $n>1$ and $j\colon\real\to\co\cup\{\co\}$.
The following conditions are equivalent.
\begin{enumerate}
\item[{\rm (i)}]  There exists a continuous nonconstant $j$-to-1
function
$f\colon\real^n\to\real$.

\item[{\rm (ii)}] There are $-\infty\leq a<b\leq\infty$
such that $j|(a,b)\equiv\co$, $j|\real\setminus[a,b]\equiv 0$, and
$|j(c)|\in\{\omega,\co\}\cup\omega$ for $c\in\{a,b\}\cap\real$.
\end{enumerate}
\end{corollary}

The corresponding characterization of Darboux functions is
slightly different.

\begin{corollary}\label{cor24}
Let $n>1$ and $j\colon\real\to\co\cup\{\co\}$.
The following conditions are equivalent.
\begin{enumerate}
\item[{\rm (i)}]
 There exists a Darboux nonconstant $j$-to-1 function
$f\colon\real^n\to\real$.

\item[{\rm (ii)}] There are $-\infty\leq a<b\leq\infty$
such that $j|(a,b)=\co$ and $j|\real\setminus[a,b]=0$.
\end{enumerate}
\end{corollary}

\proof
(i)$\Rightarrow$(ii)
This follows immediately from Proposition~\ref{P3}.

(ii)$\Rightarrow$(i) Let $a$ and $b$ be as in (ii).  Recall that
 every connectivity function $f\colon\real^n\to\real$, with
 $n>1$, is Darboux.  (See \cite{GN}.) In \cite{CR} there has been
 constructed a connectivity function $g\colon\real^n\to\real$
 such that for some dense $G_\delta$ set $G\subset\real^n$ any
 modification of $g$ on $G$ results still a connectivity
 function. Now, if $h$ is a homeomorphism from $\real$ onto
 $(a,b)$ then $f_0=h\circ g$ has a property that a function
 $f\colon\real^n\to[a,b]$ is connectivity provided $f$ which
 agrees with $f_0$ outside of $G$.  (Compare also
\cite[thm.~1]{Ro}.)
Now, take disjoint sets $A,B\subset G$ such that
$|j(a)|=|A|$ and $|j(b)|=|B|$. Define $f(x)=a$ for $x\in A$,
$f(x)=b$ for $x\in B$, and $f(x)=f_0(x)$ for
$x\in\real^n\setminus(A\cup B)$.
Then $f$ is connectivity, so Darboux,
and it has all other required properties. \qed

\medskip

In the remainder of this section we will consider functions
$f\colon[0,1]\to\real$.

\begin{proposition}
Assume that $n>1$. There is no continuous function
$f\colon[0,1]\to\real$ which is $n$-to-1.
\end{proposition}

\proof
For $n=2$ it is easy and well-known.  (See \cite{OGH} and \cite{NW}.)
Suppose that $n>2$. Let
$y_1=\max_{x\in [0,1]}f(x)$ and let
$f^{-1}(y_1)=\{x_1,\ldots,x_n\}$ where
$x_1<\cdots<x_n$. Now, if $y_0=\max\{\min f|[x_i,x_{i+1}]\colon
i=1,\ldots,n-1\}$
then for each $y\in (y_0,y_1)$, $f^{-1}(y)$ has at least
$2(n-1)>n$ points, a contradiction. \qed

\medskip

Following Theorem 5.2 in \cite{BC}, Bruckner and Ceder stated
 that there exists a continuous function defined on $[0,1]$ such
 that each value between 0 and 1 is taken on infinitely often.
 Such a function can be constructed by suitably modifying the
 well-known Cantor function on its interval of constancy.  For
 completeness we will include such a construction in the
 following proposition.

\begin{proposition}
 If $\kappa\in\{\omega,\co\}$ then there is a continuous
 function $f\colon[0,1]\rightarrow[0,1]$ such that
 $|f^{-1}(y)|=\kappa $ for each $y\in[0,1]$.
\end{proposition}
\proof
An example of a continuous function $f\colon [0,1]\to [0,1]$
such that $|f^{- 1}(y)|=\co$ for each $y\in [0,1]$ can be found in
Bruckner's book~\cite[pp. 148--150]{AB}.

Thus assume that $\kappa=\omega$
and define function $g\colon\real\to\real$ by a formula $g(x)=(x^2 + 1)^{-1}\sin x$
Notice that $\lim_{x\to-\infty} g(x)=\lim_{x\to\infty} g(x)=0$.
In particular, $g$ takes value $0$ infinitely many times and
all other values only finitely many times.
Let $C \subset I$ be the ternary Cantor set, i.e.,
\[
C=\left\{\sum_{i=1}^\infty\frac{k_i}{3^i}\colon k_i\in\{0,2\}\ \text{
for
every }
i=1,2,\ldots\right\}
\]
and let $f_0$ be the Cantor function from $C$ {\em onto\/} $[0,1]$,
that is, given by a formula
$f_0(\sum_{i=1}^\infty\frac{k_i}{3^i})
=\sum_{i=1}^\infty\frac{k_i}{2^{i+1}}$.
Thus $f_0$ is
continuous, increasing, and if $I=(a,b)$ is a component of
$[0,1]\setminus C$
then $f_0(a)=f_0(b)$.
Extend $f_0$ to $f$ by putting on any such interval
$f(x)=f_0(a)+(b-a) g(h_I(x))$, where $h_I$ is an increasing
homeomorphism
from $I=(a,b)$ onto $\real$.
It is easy to see that $f$ is continuous and $\omega$-to-1.
\qed


\begin{corollary}\label{cor2222}
Let $\kappa\leq\co$ be a cardinal number.
The following conditions are equivalent.
\begin{enumerate}
\item[{\rm (i)}]
 There exists a continuous nonconstant $\kappa$-to-1
function $f\colon[0,1]\to[0,1]$.

\item[{\rm (ii)}] $\kappa\in\{\omega,\co\}$.
\end{enumerate}
\end{corollary}

\section{Perfect road functions}

Recall that a function $f\colon\real\to\real$ has a {\it perfect
 road\/} at $x\in\real$ if there exists a perfect set
 $P\subset\real$ having $x$ as a bilateral limit point for which
 the restriction $f|P$ of $f$ to $P$ is continuous at $x$.
 The function $f\colon\real\to\real$ has the perfect road property if
 it has a perfect road at each point $x\in\real$.  (See, e.g.,
\cite{GN}.)


\begin{theorem}\label{T-PR}
 For every function $j\colon\real\to\co\cup\{\co\}\setminus\{0\}$ there
 exists a $j$-to-1 function $f_{j}\colon\real\to\real$ with the
 perfect road property.
\end{theorem}

\proof Let $\{ \langle I_n,J_n\rangle \colon n<\omega\}$ be a
 one-to-one enumeration of all sets of the form $(p,q)\times
 (r,s)$, where $p,q,r,s$ are rationals, $p<q$, and $r<s$.
 Inductively choose the sequences $\{ P_n\colon n<\omega\}$ and
 $\{Q_n\colon n<\omega\}$ of pairwise disjoint perfect nowhere
 dense sets such that $P_n\subset I_n$ and $Q_n\subset J_n$ for
 every $n<\omega$

Let $g\colon\bigcup_{n<\omega} P_n\to\bigcup_{n<\omega} Q_n$ be a
 function such that $g|P_n$ is a homeomorphism between $P_n$ and
 $Q_n$ for every $n<\omega$. Notice that
\begin{equation}\label{claim1}
\text{every extension $f\colon\real\to\real$ of $g$
has the perfect road property.}
\end{equation}
 Indeed, to show that $f$ has a perfect road from the left at a
 point $x\in\real$ find a sequence $\{n_j\}_{j<\omega}$ such that
 $I_{n_j}<I_{n_k}$ and $J_{n_j}<J_{n_k}$ for every $j<k<\omega$
 and that $\lim_{j\to\infty} I_{n_j}=x$ and $\lim_{j\to\infty}
 J_{n_j}=f(x)$.  Then $f\left|\left(\{x\}\cup\bigcup_{j<\omega}
 P_{n_j}\right)\right.$ is continuous at $x$.  The right hand
 side perfect road at $x$ can be found similarly, proving
 (\ref{claim1}).

To find an appropriate extension $f_j$ of $g$ note that
 $G=\real\setminus\bigcup_{n<\omega}P_n$ has cardinality $\co$.
 Thus there exists a partition $\{X_y\colon y\in\real\}$ of $G$
 such that $|X_y|=|j(y)|$ if $y\notin\bigcup_{n<\omega}Q_n$ and
 $|X_y|=|j(y)|-1$ for $y\in\bigcup_{n<\omega}Q_n$. Finally put
\[
f_j(x)=\left\{
\begin{array}{cl}
g(x) & \mbox{for $x\in \bigcup_{n<\omega} P_n$} \\
y & \mbox{for $x\in X_y$ and $y\in\real$.}
\end{array}
\right.
\]
It is easy to observe that $f_j$ has the desired properties. \qed
\medskip


Next we will consider a question for which functions
 $j\colon\real\to\co\cup\{\co\}$ a function $f_j$ as in
 Theorem~\ref{T-PR} can be Borel measurable. Clearly, if
 $f\colon\real\to\real$ is a Borel onto function then the function
 $j_f\colon\real\to\co\cup\{\co\}$ defined by
 $j_f(y)=|f^{-1}(y)|$ must be ``nice.'' In particular,
 $j_f\colon\real\to {\cal K}_0=(\omega\setminus\{
 0\})\cup\{\omega,\co\}$.  In the following theorems we shall consider
 ${\cal K}_0$ as the topological space with the discrete
 topology.

\begin{theorem}\label{T-PRB}
If $j\colon\real\to{\cal K}_0$ is a Borel
function then there exists a Borel
$j$-to-1 function $f_j\colon\real\to\real$ with the
perfect road property.
\end{theorem}

\proof
 Let $g\colon\bigcup_{n<\omega}P_n\to\bigcup_{n<\omega}Q_n$
 satisfy the condition (\ref{claim1}).  Note that
 $\hat{\j}\colon\real\to\omega\cup\{\omega,\co\}$ given by
 $\hat{\j}(y)=j(y)$ if $y\notin\bigcup_{n<\omega}Q_n$ and
 $\hat{\j}(y)=j(y)-1$ if $y\in\bigcup_{n<\omega}Q_n$ is Borel as
 well. Partition $G=\real\setminus\bigcup_{n<\omega}P_n$ into
 Borel sets $\{B_{\kappa}\colon \kappa\in{\cal K}_0\}$ such that
 $|B_{\kappa}|=\kappa\otimes|\hat{\j}^{-1}(\kappa)|$ for every
 $\kappa\in{\cal K}_0$. We claim that

\begin{equation}\label{claim2}
\text{for every $\kappa\in{\cal K}_0$ there is a $\kappa$-to-1
 Borel function $f_{\kappa}\colon
 B_{\kappa}\to\hat{\j}^{-1}(\kappa)$.}
\end{equation}

First note that (\ref{claim2}) implies immediately the theorem,
 since then $f_j\colon\real\to\real$ defined by
\[
f_j(x)=\left\{
\begin{array}{cl}
g(x) & \mbox{for $x\in\bigcup_{n<\omega} P_n$} \\
f_{\kappa}(x) & \mbox{for $x\in B_{\kappa}$ and $\kappa\in {\cal
K}_0$}
\end{array}
\right.
\]
clearly has the desired properties.

To prove (\ref{claim2}) we will consider three cases.

If $\kappa<\co$ partition $B_{\kappa}$ into Borel sets
 $\{B^i_{\kappa}\colon i<\kappa\}$ each of cardinality
 $|\hat{\j}^{-1}(\kappa)|$ and for every $i<\kappa$ define
 $f_{\kappa}$ on $B^i_{\kappa}$ as a Borel isomorphism between
 $B^{i}_{\kappa}$ and $\hat{\j}^{- 1}(\kappa)$.  (Recall that any
 two Borel sets of the same size are Borel isomorphic. See, e.g.,
\cite[p.~451]{KK} or \cite[thm 15.6, p.~90]{AK}.)

If $\kappa=\co$ and $\lambda=|\hat{\j}^{-1}(\co)|<\co$ then
 $\lambda\leq\omega$. Partition $B_{\co}$ onto $\lambda$ Borel
 sets $\{B_{\co}^y\colon y\in\hat{\j}^{-1}(\co)\}$ each of
 cardinality $\co$ and define $f_\co(x)=y$ for $x\in B_\co^y$.

If $\kappa=\hat{\j}^{-1}(\co)=\co$ then define $f_{\co} $ as a
 $\co$-to-1 Borel function from $B_{\co}$ onto
 $\hat{\j}^{-1}(\co)$.  Such an $f_{\co}$ can be constructed in
 the following way. Let ${\cal N}$ denote the space of all
 irrationals.  Let $\varphi$ be a Borel isomorphism between
 $B_{\co}$ and ${\cal N}\times{\cal N}$,
 $\varphi=(\varphi_1,\varphi_2)$, and let $\psi$ be a Borel
 isomorphism between ${\cal N}$ and $\hat{\j}^{-1}(\co)$. Define
 $f_{\co}= \psi\circ\varphi_1$. Then $f_{\co}$ is $\co$-to-1 and
 Borel measurable. \qed

\medskip

We finish this section with the following
remark.

\begin{proposition}
Assume that $f\colon\real\to\real$ is Borel measurable. Then
\begin{enumerate}
\item[{\rm (i)}]
the set $j_f^{-1}(\co)$ is analytic;
\item[{\rm (ii)}]
the set $j_f^{-1}(1)$ can be co-analytic and non-Borel.
\end{enumerate}
\end{proposition}
\proof
 The statement (i) is a consequence of
 the Mazurkiewicz-Sierpi{\'n}ski theorem (see \cite[thm~29.19,
 p.~231]{AK}), because the graph of Borel measurable function
 from $\real$ into $\real$ is a Borel subset of $\real^2$. (See
\cite[thm. 14.12, p.~88]{AK}.)

To prove (ii) fix an analytic non-Borel set $A\subset\real$.
 (Such sets exist by the Suslin theorem \cite[thm.~14.2, p.~85]{AK}.)
 There exists a continuous function $h\colon {\cal N}\to\real$
 with $h[{\cal N}]=A$.  (See \cite[p.~85]{AK}.) Let
 $\varphi\colon{\cal N}\to{\cal N}\times 2$ be a homeomorphism,
 $\varphi=\la\varphi_0,\varphi_1\ra$, and let ${\cal
 N}_i=\varphi_1^{-1}(i)$ for $i=0,1$.  Observe that $f_0\colon
 {\cal N}_0\to \real$ defined by $f_0(x)=h(\varphi_0(x))$ is
 continuous and $f_0[{\cal N}_0]=A$.  Let $f_1\colon
\real\setminus {\cal N}_0 \to \real$ be a Borel
 isomorphism. (See the isomorphism theorem \cite[thm~15.6,
 p.~90]{AK}.) Put $f=f_0\cup f_1$. Then $f$ is Borel measurable
 and $j_f^{-1}(1)=\real\setminus A$.  Thus $j_f^{-1}$ is
 co-analytic and, by the Lusin Separation Theorem \cite[thm~14.7,
 p.~87]{AK}, it is non-Borel.
\qed


\section{CIVP functions}
 Recall the following definitions that are introduced in
\cite{CIVP}
and \cite{RGR}, respectively. (See also \cite{GN}.)
\begin{itemize}
\item
$f\colon\real\to\real$ has the {\it Cantor intermediate value
property\/} (CIVP), if for every $x,y\in \real$ and for
each Cantor set $K$ between $f(x)$ and $f(y)$ there is a Cantor
set $C$ between $x$ and $y$ such that $f[C]\subset K$.
\item
 $f\colon\real\to\real$ has the {\it strong Cantor intermediate
 value property\/} (SCIVP), if for every $x,y\in \real$ and for
 each Cantor set $K$ between $f(x)$ and $f(y)$ there is a Cantor
 set $C$ between $x$ and $y$ such that $f[C]\subset K$ and $f|C$
 is continuous.
\end{itemize}
 The notion {\it Cantor set\/} means a perfect nowhere dense set.
 Note that in the definitions above the Cantor sets can be replaced by
 perfect sets.

\begin{theorem}\label{T-CIVP}
 For every function $j\colon\real\to\co\cup\{\co\}\setminus\{0\}$ there
 exists a $j$-to-1 function $f_j\colon\real\to\real$ with
 CIVP.\footnote{Although Theorem~\ref{T-CIVP} implies
 Theorem~\ref{T-PR}, their proofs are different, and we used the
 proof of Theorem~\ref{T-PR} in Theorem~\ref{T-PRB}.}
\end{theorem}

\proof
 Let ${\cal P}$ be a family of pairwise disjoint perfect
subsets of $\real$ such that
$|\real\setminus\bigcup{\cal P}|=\co$ and
$|\{ P\in{\cal P}\colon P\subset(a,b)\}|=\co$
for any $a<b$.
Take an enumeration
$\{ \langle U_{\xi},Q_{\xi}\rangle\colon \xi<\co\}$
of $\{(a,b)\colon
a<b\}\times\{ Q\subset\real\colon Q \mbox{ is perfect}\}$.

For every $\xi<\co$ choose $P_{\xi}\in{\cal P}$ such that
 $P_{\xi}\subset U_{\xi}$ and $P_{\xi}\neq P_{\eta}$ for
 $\xi\neq\eta$.  Finally, partition $\real$ into Bernstein sets
 $\{ B_{\xi}\colon \xi\leq\co\}$ and define a function
 $f_0\colon\bigcup_{\xi<\co}P_{\xi}\to\real$ such that for every
 $\xi<\co$ the restriction $f_0|P_{\xi}$ is a bijection between
 $P_{\xi}$ and $B_{\xi}\cap Q_{\xi}$.  Then $f_0$ is one-to-one,
 since sets $B_{\xi}$ are pairwise disjoint.  Notice that

\begin{equation}\label{claim3}
\text{any extension $f\colon\real\to\real$ of $f_0$ has the CIVP.}
\end{equation}
 Indeed, fix $a<b$ such that $f(a)\neq f(b)$ and a perfect set
 $K$ between $f(a)$ and $f(b)$. There exists $\xi<\co$ such that
 $(a,b)=U_{\xi}$ and $K=Q_{\xi}$. Then $P_{\xi}$ is a perfect set
 between $a$ and $b$ and $f[P_{\xi}]\subset K$.

To finish the proof let $G=\real\setminus\bigcup_{\xi<\co}P_{\xi}
 $ and $Z=\real\setminus f_0[\bigcup_{\xi<\co}P_{\xi}]$.  Observe
 that $|G|=|Z|=\co$ because $\real\setminus \bigcup {\cal
 P}\subset G$ and $B_{\co}\subset Z$. Partition $G$ into sets $\{
 X_y\colon y\in\real\}$ such that $|X_y|=|j(y)|$ for $y\in Z$ and
 $|X_y|=|j(y)|-1$ for $y\in\real\setminus Z$. Finally, it is easy
 to verify that the function $f_j\colon\real\to\real$ defined by
\[
f_j(x)=\left\{
\begin{array}{cl}
f_0(x) & \mbox{for $x\in\bigcup_{\xi<\co}P_{\xi}$} \\
y & \mbox{for $x\in X_y$ and $y\in\real$}
\end{array}
\right.
\]
satisfies all assertions of the theorem. \qed
\medskip

It seems to be reasonable to ask whether $f_j$ in
 Theorem~\ref{T-CIVP} can be Borel if $j\colon \real\to {\cal
 K}_0$ is Borel. However it is easy to see that if a Borel
 function $f\colon\real\to\real$ has the CIVP, then it has also
 the SCIVP. (See e.g., \cite[p.~500]{GN}.) The case of SCIVP
 functions will be covered in the next section.

\section{SCIVP functions}

The analog of Theorem~\ref{T-CIVP} does not hold.  This follows
 from the following analog of Proposition~\ref{prop1.1}.

\begin{theorem}\label{T-SCIVP}
Let $f\colon\real\to\real$ be a countable-to-1
SCIVP function. If $f^{-1}(y)$
is closed for every $y\in\real$ then $f$ is continuous.
\end{theorem}

\proof
Suppose that $f$ is discontinuous at some $x\in\real$
from the right. We can assume that
${\limsup}_{h\to 0^+}f(x+h)=L>f(x)$.
 Choose $M\in(f(x),L)$, $m\in(f(x),M)$, and $x_0\in(x,x+1)$ such
 that $f(x_0)>M$.  Let $Q_0\subset(m,M)\subset(f(x),f(x_0))$ be
 perfect.  By SCIVP there exists a perfect set
 $P_0\subset(x,x_0)$ such that $f|P_0$ is continuous and
 $f[P_0]\subset Q_0$.  Observe that $|f[P_0]|=\co$, so we can
 choose a perfect subset $Q_1$ of $f[P_0]\subset Q_0$. Next find
 $x_1\in (x,x+1/2)$ such that $(x,x_1)\cap P_0=\emptyset$ and
 $f(x_1)>M$. Then $Q_1\subset
 Q_0\subset(m,M)\subset(f(x),f(x_1))$.  Thus, by SCIVP we can
 find perfect sets $P_1\subset (x,x_1)$ and $Q_2\subset
 f[P_1]\subset Q_1$.  In this way we define by induction for
 every $n<\omega$, $n>0$:

\begin{itemize}
\item
$x_n\in (x,x+1/(n+1))$ such that $(x,x_n)\cap P_{n-1}=\emptyset$
and  $f(x_n)>M$,

\item  perfect sets $P_n\subset (x,x_n)$ and
$Q_n\subset f[P_n]\subset Q_{n-1}\subset(m,M)$.
\end{itemize}
 Let $y\in \bigcap_{n<\omega} Q_n$. Then $f^{-1}(y)\cap
 P_n\neq\emptyset$ for every $n$, so $x$ belongs to the closure
 of $f^{-1}(y)$. But $x\notin f^{-1}(y)$, since $f(x)<m<y$, a
 contradiction.
\qed

\begin{corollary}
\label{C-SCIVP} If $f\colon\real\to\real$ is SCIVP and
finite-to-1 then it is continuous. \qed
\end{corollary}

Clearly there exist discontinuous SCIVP functions which are
$\omega$-to-1. For example, the function
\[
f(x)=\left\{
\begin{array}{ll}
\sin(1/x) & \mbox{for $x\neq 0$;} \\
0 & \mbox{for $x=0$}
\end{array}
\right.
\]
has this property.

\begin{proposition}\label{pn}
There exists an $\omega$-to-1 SCIVP
function
$f\colon\real\to\real$ that is nowhere continuous.
\end{proposition}
\proof
Let $\la P_n\ra_n$ be a sequence of pairwise disjoint nowhere dense perfect sets such
that every non-degenerate interval contains some $P_n$. For every $n$ let
$\hat{P}_n=P_n\setminus \{\min(P_n),\max(P_n)\}$ and let $f_n$ be a continuous
non-decreasing Cantor-like function from $\hat{P}_n$ onto $\real$ that is $\leq 2$-to-1.
Moreover, let $g$ be an injection from $\real\setminus\bigcup_n\hat{P}_n$ onto $\real$. 
Put $f=g\cup\bigcup_n f_n$. 
Then
\begin{itemize}
\item
$f$ maps intervals onto the whole real line, so it is nowhere continuous;
\item
$f$ is $\omega$-to-one;
\item
$f$ has SCIVP. Indeed, let $a<b$, $K\subset (f(a),f(b))$ be a perfect set, and
$P_n\subset (a,b)$. Then there exists a perfect set $C\subset P_n$ with 
$f[C]\subset K$. \qed
\end{itemize}



Also, it is well-known that there exist SCIVP functions that are
 $\co$-to-1. (Actually there are continuous functions with this
 property.) Moreover there exist nowhere continuous SCIVP
 functions $f\colon\real\to\real$ that are $\co$-to-1. An example
 of such a function one can find in
\cite{KB}. For completeness sake we will repeat here an  easy
construction of such a function.

\begin{proposition}
\label{T-SCIVP2} 
There exists a $\co$-to-1 SCIVP
function
$f\colon\real\to\real$ that is nowhere continuous.
\end{proposition}

\proof
 Let ${\cal P}$ be a family of pairwise disjoint perfect sets
 with the property that $|\real\setminus\bigcup{\cal P}|=\co$ and
 $|\{P\in{\cal P}\colon P\subset (a,b)\}|=\co$ for every $a<b$.
 Let $\{ \langle J_{\xi},r_{\xi}\rangle \colon\xi<\co\}$ be an
 enumeration of $\{ (a,b)\colon a<b\}\times\real$. Choose
 pairwise disjoint sets $P_{\xi}\in{\cal P}$ such that
 $P_{\xi}\subset J_{\xi}$ for every $\xi<\co$ and define $f_0$ on
 $\bigcup_{\xi<\co}P_{\xi}$ by making $f_0|P_{\xi}\equiv
 r_{\xi}$. It is easy to see that any extension
 $f\colon\real\to\real$ of $f_0$ has the SCIVP and is nowhere
 continuous. \qed

\begin{thebibliography}{99}

\bibitem{KB}  K. Banaszewski, {\it Algebraic properties of functions
 with the Cantor intermediate value property}, Math. Slovaca {\bf
 47} (1997), to appear.

\bibitem{AB} A. M. Bruckner, {\it Differentiation of real functions},
CMR Series Vol. 5, Amer. Math. Soc. 1994.

\bibitem{BC}  A. M. Bruckner and J. Ceder, {\it Darboux Continuity},
Jahresber. Deutsch. Math.-Verein. {\bf 67} (1965), 93--117.

\bibitem{Ci:book}  K.~Ciesielski,
{\it Set Theory for the Working Mathematician},
London Math. Soc. Student Texts {\bf 39},
Cambridge Univ. Press 1997.

\bibitem{CR}  K.~Ciesielski and I.~Rec{\l }aw,
{\it Cardinal invariants concerning
extendable and peripherally continuous functions},
Real Anal. Exchange {\bf 21}
(1995--96), 459--472. (Preprint$^\star$  available.%
\footnote{Preprints marked by $^\star$ are available in electronic
form
%. They can be accessed
accessible from {\it Set Theoretic Analysis Web Page:}
http://www.math.wvu.edu/homepages/kcies/STA/STA.html})

\bibitem{PC}  P. Civin, {\it Two-to-one mappings on manifolds},
Duke Math. J.
{\bf 10} (1943), 49--57.

\bibitem{CIVP}
R. G. Gibson and F. Roush, {\it The Cantor intermediate
value property}, Top. Proc. {\bf 7} (1982), 55--62.

\bibitem{GN}  R. G. Gibson and T. Natkaniec, {\it Darboux like
functions},
Real Anal. Exchange {\bf 22}(2) (1996--97), 492--534.
(Preprint$^\star$ available.)

\bibitem{PG} P. Gilbert, {\it n-to-1 mappings of linear graphs},
 Duke  Math. J. {\bf 9} (1942), 475--486.

\bibitem{DG}  D. C. Gillespie, {\it A property of continuity}, Bull.
Amer. Math. Soc. {\bf 28} (1922), 245--250.

\bibitem{OGH} O. G. Harrold, Jr., {\it The non-existence of a
 certain type of continuous transformation},
Duke Math. J. {\bf 5} (1939), 789--793.

\bibitem{JH}  J. Heath, {\it k-to-1 functions between graphs with
finitely
many discontinuities}, Proc. Amer. Math. Soc. {\bf 103}(2) (1988),
661--666.

\bibitem{KKK}  H. Katsuura and K. Kellum, {\it k-to-1 functions on an
arc},
Proc. Amer. Math. Soc. {\bf 101}(4) (1987), 629--633.

\bibitem{AK}
A.~S.~Kechris, {\it Lectures on classical descriptive set
theory}, Springer Verlag, Berlin 1995.

\bibitem{KK} K. Kuratowski, {\it Topology}, Vol. 1, Academic
 Press --  Polish Scientific Publishers, 1966.

\bibitem{NW} S. Nadler, Jr. and L. Ward, Jr., {\it Concerning exactly
 (n,1) images of continua}, Proc. Amer. Math. Soc.  {\bf 87}(2)
 (1983), 351--354.

\bibitem{JHR}  J. H. Roberts, {\it Two-to-one transformations}, Duke
Math. J. {\bf 6} (1940), 256--262.

\bibitem{Ro} H.~Rosen, {\it Limits and sums of extendable connectivity
functions}, Real Anal. Exchange {\bf 20} (1994--95),
183--191.

\bibitem{RGR}
H. Rosen, R. G. Gibson, and F. Roush, {\it Extendable
 functions and almost continuous functions with a perfect road},
 Real Anal. Exchange {\bf 17} (1991--92), 248--257.

\end{thebibliography}

\end{document}