The map $|X| \to |Y|$ is open. The set of irreducible components of $|X|$ is locally finite in $|X|$. We conclude that $f|_{X'} : X' \to Y$ is dominant for every irreducible component $X' \subset X$. Thus $g \circ f|_{X'}$ is defined (Morphisms of Spaces, Section \ref{spaces-morphisms-section-rational-maps}), hence $\text{div}_{X'}(g \circ f|_{X'})$ is defined. Moreover, the sum is locally finite and we find that the right hand side indeed is a cycle on $X$. The left hand side is defined by Definition \ref{definition-flat-pullback} and the fact that an \'etale morphism is flat of relative dimension $0$. \medskip\noindent Since $f$ is \'etale we see that $\delta_X(x) = \delta_y(f(x))$ for all $x \in |X|$. Thus if $\dim_\delta(Y) = n$, then $\dim_\delta(X') = n$ for every irreducible component $X'$ of $X$ (since generic points of $X$ map to the generic point of $Y$, see above). Thus both left and right hand side are $(n - 1)$-cycles. \medskip\noindent Let $Z \subset X$ be an integral closed subspace with $\dim_\delta(Z) = n - 1$. To prove the equality, we need to show that the coefficients of $Z$ are the same. Let $Z' \subset Y$ be the integral closed subspace constructed in Lemma \ref{lemma-proper-image}. Then $\dim_\delta(Z') = n - 1$ too. Let $\xi \in |Z|$ be the generic point. Then $\xi' = f(\xi) \in |Z'|$ is the generic point. Consider the commutative diagram $$ \xymatrix{ \Spec(\mathcal{O}_{X, \xi}^h) \ar[r] \ar[d] & X \ar[d] \\ \Spec(\mathcal{O}_{Y, \xi'}^h) \ar[r] & Y } $$ of Decent Spaces, Remark \ref{decent-spaces-remark-functoriality-henselian-local-ring}. We have to be slightly careful as the reduced Noetherian local rings $\mathcal{O}_{X, \xi}^h$ and $\mathcal{O}_{Y, \xi'}^h$ need not be domains. Thus we work with total rings of fractions $Q(-)$ rather than fraction fields. By definition, to get the coefficient of $Z'$ in $\text{div}_Y(g)$ we write the image of $g$ in $Q(\mathcal{O}_{Y, \xi'}^h)$ as $a/b$ with $a, b \in \mathcal{O}_{Y, \xi'}^h$ nonzerodivisors and we take $$ \text{ord}_{Z'}(g) = \text{length}_{\mathcal{O}_{Y, \xi'}^h} (\mathcal{O}_{Y, \xi'}^h/a \mathcal{O}_{Y, \xi'}^h) - \text{length}_{\mathcal{O}_{Y, \xi'}^h} (\mathcal{O}_{Y, \xi'}^h/b \mathcal{O}_{Y, \xi'}^h) $$ Observe that the coefficient of $Z$ in $f^*\text{div}_Y(G)$ is the same integer, see Lemma \ref{lemma-etale-pullback}. Suppose that $\xi \in X'$. Then we can consider the maps $$ \mathcal{O}_{Y, \xi'}^h \to \mathcal{O}_{X, \xi}^h \to \mathcal{O}_{X', \xi}^h $$ The first arrow is flat and the second arrow is a surjective map of reduced local Noetherian rings of dimension $1$. Therefore both these maps send nonzerodivisors to nonzerodivisors and we conclude the coefficient of $Z'$ in $\text{div}_{X'}(g \circ f|_{X'})$ is $$ \text{ord}_Z(g \circ f|_{X'}) = \text{length}_{\mathcal{O}_{X', \xi}^h} (\mathcal{O}_{X', \xi}^h/a \mathcal{O}_{X', \xi}^h) - \text{length}_{\mathcal{O}_{Y, \xi'}^h} (\mathcal{O}_{X', \xi}^h/b \mathcal{O}_{X', \xi}^h) $$ by the same prescription as above. Thus it suffices to show $$ \text{length}_{\mathcal{O}_{Y, \xi'}^h} (\mathcal{O}_{Y, \xi'}^h/a \mathcal{O}_{Y, \xi'}^h) = \sum\nolimits_{\xi \in |X'|} \text{length}_{\mathcal{O}_{X', \xi}^h} (\mathcal{O}_{X', \xi}^h/a \mathcal{O}_{X', \xi}^h) $$ First, since the ring map $\mathcal{O}_{Y, \xi'}^h \to \mathcal{O}_{X, \xi}^h$ is flat and unramified, we have $$ \text{length}_{\mathcal{O}_{Y, \xi'}^h} (\mathcal{O}_{Y, \xi'}^h/a \mathcal{O}_{Y, \xi'}^h) = \text{length}_{\mathcal{O}_{X, \xi}^h} (\mathcal{O}_{X, \xi}^h/a \mathcal{O}_{X, \xi}^h) $$ by Algebra, Lemma \ref{algebra-lemma-pullback-module}. Let $\mathfrak q_1, \ldots, \mathfrak q_t$ be the nonmaximal primes of $\mathcal{O}_{X, \xi}^h$ and set $R_j = \mathcal{O}_{X, \xi}^h/\mathfrak q_j$. For $X'$ as above, denote $J(X') \subset \{1, \ldots, t\}$ the set of indices such that $\mathfrak q_j$ corresponds to a point of $X'$, i.e., such that under the surjection $\mathcal{O}_{X, \xi}^h \to \mathcal{O}_{X', \xi}$ the prime $\mathfrak q_j$ corresponds to a prime of $\mathcal{O}_{X', \xi}$. By Chow Homology, Lemma \ref{chow-lemma-additivity-divisors-restricted} we get $$ \text{length}_{\mathcal{O}_{X, \xi}^h} (\mathcal{O}_{X, \xi}^h/a \mathcal{O}_{X, \xi}^h) = \sum\nolimits_j \text{length}_{R_j}(R_j/a R_j) $$ and $$ \text{length}_{\mathcal{O}_{X', \xi}^h} (\mathcal{O}_{X', \xi}^h/a \mathcal{O}_{X', \xi}^h) = \sum\nolimits_{j \in J(X')} \text{length}_{R_j}(R_j/a R_j) $$ Thus the result of the lemma holds because $\{1, \ldots, t\}$ is the disjoint union of the sets $J(X')$: each point of codimension $0$ on $X$ lies on a unique $X'$.