This kind of question is more easily adressed on the “other” side of algebraic geometry: let us look at what happens at level of function algebras.
Assume $f_0: X_0 \to Y_0$ is the corestriction of your morphism on a affine open subset $Y_0$ of $Y$ and a restriction to a $G$-stable affine open subset $X_0$ of $X$ mapped in $Y_0$ by $f$.
On the side of algebras, you have a morphism of algebras $A(f_0): A(Y_0) \to A(X_0)$ whose image is contained in the subalgebra $A(X_0)^G$ of $G$-invariant functions. So you can decompose $A(f_0) = A(\pi_0) \circ j$, where $j$ is induced by the canonical inclusion of $A(X_0)^G$ in $A(X_0)$ and define $\bar f$ by $A(\bar f) = j$.
In some situations, it might be impossible to find that $X_0$. Consider the case of the normaliser $N$ of a maximal torus $T$ in $\mathbf{SL}_2$ operating on $\mathbf{P}^1$: the element generating $N/T$ exchanges the two fixed points of $T$ so none of them is contained in a suitable $X_0$. This is why the theory of stable points used by Mumford has to remove these points before doing the quotient.