Determine whether a rational function on the codomain of a surjective morphism is regular Let $X$ be a smooth affine algebraic variety with a (not necessarily free) action by an algebraic torus $T$. Let $Y$ be the quotient stack $X/T$ and let $p:X\rightarrow Y$ be the quotient map. Suppose $f$ is a rational function on $Y$ and its pull-back $p^*f$ is a regular function on $X$. Does it follow that $f$ is also a regular function on $Y$?
 A: Assuming that by a rational function you mean a section of $\mathcal O_Y$ defined on a nonempty open substack, the answer is yes, as long as $X$ is integral (more generally if $X$ is only reduced, we need some density assumption on the open substack).
Indeed, let $V \subseteq Y$ be an open substack with inverse image $U \subseteq X$, let $f \in \mathcal O_Y(V)$, and assume $\rho^* f \in \mathcal O_X(U)$ extends to $g \in \mathcal O_X(X)$. The quotient stack $[X/T]$ is given by the groupoid
$$\begin{array}{ccc} & & T \times X & & \\ & \swarrow & & \searrow & \\ X & & & & X,\! \end{array}$$
where the source and target maps are the projection $s = \pi$ and the action $t = a$; see Tag 0444 for details. In fact, the commutative diagram
$$\begin{array}{ccc}T \times X & \to & X \\ \downarrow & & \downarrow \\ X & \to & Y\end{array}$$
is a $2$-fibre product diagram; see Tag 04M9. Restricting to $V \subseteq Y$ gives
$$\begin{array}{ccc}T \times U & \to & U \\ \downarrow & & \downarrow \\ U & \to & V.\!\end{array}$$
We have a section $g \in \mathcal O_X(X)$, and the pullbacks along $a$ and $\pi$ to $T \times X$ agree on $T \times U$ since they come from $f \in \mathcal O_Y(V)$. Since $X$ is integral, so is $T \times X$, so two sections that agree on $T \times U$ are equal. This gives the cocycle condition to glue to a section of $\mathcal O_Y(Y)$ since $\mathcal O_Y$ is an fppf sheaf; see Tag 06TU (or use Tag 044U for maps to $\mathbf A^1$). $\square$
