Suppose I have a function $f: \mathbb{R}^n \to \mathbb{R}$
$y = f(x)$
But $x$ is the solution to a differential equation $\dot x = g(x)$, so it depends on time.
Can I take the time derivative of $f$ even though it is not defined as a function of time?
Note: my confusion is that $f$ is not a function that explicitly depends on time, i.e. the argument of $f$ is not time.
Yes, as your function is really $$y=f(x(t))$$ Its derivative is therefore $$f'(x(t))\cdot g(x(t))$$ by the chain rule and since $x'(t)=g(x(t))$.