Relation between canonical bundles under étale maps Let $X$ and $Y$ be two integral separated Noetherian Gorenstein schemes over a base field $k$ of arbitrary characteristic whose local rings are unique factorization domains and $f: X\to Y$ an étale map between them. Since we assumed these to be Gorenstein, their canonical bundles $\omega_X$, resp. $\omega_Y$ exist and are line bundles / invertible sheaves.
The map $f$ induces via pullback the map $f^*: \text{Pic}(Y) \to \text{Pic}(X)$ between Picard groups and the rather natural question which arrises at this point is how $\omega_X$ and $f^*\omega_Y$ are related to each other?
Since $X$ and $Y$ where moreover assumed to be integral separated and locally factorial and therefore the Cartier divisors coincide with Weil-divisors, this question question can be equivalently stated in terms of Weil divisors and canonical classes: how $K_X$ and $f^*K_Y$ are related to each other? Is there any explicitly formula known?
If we think of étale maps as algebro geometric pendants to topological coverings, then in case $X$ and $Y$ smooth ($\simeq$ manifolds in topological sense) one could expect/hope that it might hold $\omega_X= f^*\omega_Y$, because in topological setting the the canonical bundles are given locally as determinant bundles of holomorphic $n$-forms and coverings are local isomorphisms.
If that's not the case in full generality for the assumptions of $X,Y$ and $f$ as above, is there at least an explicit formula à la Hurwitz for smooth curves/Riemann surfaces known relating $\omega_X$ and $ f^*\omega_Y$ to each other?
If yes, how general this formula is? Does it only hold for smooth $Y,X$? Depend it on characteristic of base field $k$?
I'm pretty sure that if we drop the étaleness assumption and so allow some even rather tame ramifications then it is nearly hopeless to expect the existence of such formula relating $\omega_X$ and $ f^*\omega_Y$ in such generality, so I hoped that maybe the étaleness assumption might provide the right amount of price which we are ready to pay to have such formula.
 A: The usual definition of $\omega_X^\bullet$ is $\pi_X^!(k[0])$, where $\pi_X \colon X \to \operatorname{Spec} k$ is the structure morphism. If $f \colon X \to Y$ is a map of $k$-schemes, we therefore get an isomorphism $f^! \omega_Y^\bullet \stackrel\sim\to \omega_X^\bullet$; see for instance [Tag 0ATX]. If $f$ is étale, then $f^! \cong f^*$ [Tag 0FWI], so we get
$$f^* \omega_Y^\bullet \stackrel\sim\to \omega_X^\bullet.$$
The next best thing is when $f$ is a perfect morphism (e.g. flat, or l.c.i., or when $Y$ is regular). In this case, we get an isomorphism $Lf^*(-) \otimes^{\mathbf L}_{\mathcal O_X} \omega_{X/Y}^\bullet \stackrel\sim\to f^!(-)$ [Tag 0B6U], giving
$$Lf^*\omega_Y^\bullet \overset{\mathbf L}{\underset{\mathcal O_X}\otimes} \omega_{X/Y}^\bullet \stackrel\sim\to \omega_X^\bullet.$$
If $Y$ is Gorenstein, then $\omega_Y^\bullet$ is invertible (in particular flat), so this simplifies to
$$f^*\omega_Y^\bullet \underset{\mathcal O_X} \otimes \omega_{X/Y}^\bullet \stackrel\sim\to \omega_X^\bullet.$$
So it remains to compute $\omega_{X/Y}^\bullet = f^! \mathcal O_Y$. For a finite morphism, this is characterised by
$$f_*f^! \mathcal O_Y = R\mathscr Hom_{\mathcal O_Y}(f_*\mathcal O_X,\mathcal O_Y),$$
viewed naturally as $f_*\mathcal O_X$-module [Tag 0AX2]. I'm not sure if there is a simpler description of this, but the subtleties of the Riemann–Hurwitz formula for wild ramification show that this computation can become a bit involved.
(Also, while quasi-finite maps of smooth curves are always flat, I'm not sure if a quasi-finite map of Gorenstein schemes is always perfect, so it is possible that the second half of this answer doesn't apply in complete generality. Maybe there are better ways to compute $f^!\omega_Y^\bullet$.)
