A function is normally defined as a mapping from one set to another; the function itself is not really a set, and a domain is (to the best of my knowledge) a set of points. So, to answer the question in your title, "not exactly." (I know this critique might cause some to roll their eyes and say "you know what I meant," but mathematics is all about rigor and precision.)
However, I understand what you're trying to ask: "how to express the range from a function as the domain of another?" The answer, of course, is "nested functions," and I think you have it right:
$s(n)=\sqrt{n}$ ($s$ is a function of $n$)
$f=\pi(s)$ (prime counting function; $f$ is a function of $s$)
$m$ is a function of $\pi(s)$
Therefore, some function $F = m(\pi(s)) = m(\pi(s(n)))$
Since we know $s(n)=\sqrt{n}$, we can make it a little shorter, but still completely nested:
$F = m(\pi(\sqrt{n}))$