  As a pioneering work we construct explicit real algebraic functions which may
have both compact and non-compact preimages.
  The author has obtained explicit real algebraic functions with preimages
satisfying some nice conditions. More precisely, we have given answers to a
considerably revised version of Sharko's question. Sharko originally asked
whether we can have nice smooth functions whose Reeb graphs are as desired. The
Reeb graph of a smooth function of a certain nice class is a natural graph
whose underlying space is the space of all connected components. Such graphs
can have some important topological information of the manifolds.
  Our answers are new in having real algebraic functions on non-compact
manifolds with no boundaries. We also avoid using so-called existence theory
and approximation theory whereas we also avoid in our previous studies.
