  We use the Aubry-Perret bound for singular curves, a generalization of the
Hasse-Weil bound, to prove the following curious result about rational
functions over finite fields: Let $f(X),g(X)\in\Bbb F_q(X)\setminus\{0\}$ be
such that $q$ is sufficiently large relative to $\text{deg}\, f$ and
$\text{deg}\, g$, $f(\Bbb F_q)\subset g(\Bbb F_q\cup\{\infty\})$, and for
``most'' $a\in\Bbb F_q\cup\{\infty\}$, $|\{x\in \Bbb
F_q:g(x)=g(a)\}|>(\text{deg}\, g)/2$. Then there exists $h(X)\in\Bbb F_q(X)$
such that $f(X)=g(h(X))$. A generalization to multivariate rational functions
is also included.
