If your hypothesis has a degree of uniformity, so that we may uniformly enumerate $f^{-1}X$ from an enumeration of $X$, that is, if given an index $e$ for a c.e. se $W_e$, then we may compute an index for $f^{1}W_e$, then the answer is yes. To compute $f(n)$, simply consider indices for the singleton sets $W_{e_m}=\{m\}$, start enumerating the pre-images $f^{-1}W_{e_m}$, and if $n$ shows up in $f^{-1}W_{e_m}$, then you know $f(n)=m$, and is otherwise not defined. And indeed, in your observation, if $f$ is computable, then we obtain the desired degree of uniformity, since there is a uniform procedure to enumerate $f^{-1}X$ from any enumeration of $X$.