We first replace $X$ by an affine open neighbourhood of $x$. Observe that $\mathcal{O}_{X, x}$ is an excellent local ring (More on Algebra, Lemma \ref{more-algebra-lemma-finite-type-over-excellent}). Thus we can choose a minimal resolution of singularities $W \to \Spec(\mathcal{O}_{X, x})$, see Resolution of Surfaces, Theorem \ref{resolve-theorem-resolve}. After possibly replacing $X$ by an affine open neighbourhood of $x$ we can find a proper morphism $b : X' \to X$ such that $X' \times_X \Spec(\mathcal{O}_{X, x}) = W$, see Limits, Lemma \ref{limits-lemma-glueing-near-closed-point}. After shrinking $X$ further, we may assume $X'$ is regular. Namely, we know $W$ is regular and $X'$ is excellent and the regular locus of the spectrum of an excellent ring is open. Since $W \to \Spec(\mathcal{O}_{X, x})$ is projective (as a sequence of normalized blowing ups), we may assume after shrinking $X$ that $b$ is projective (details omitted). Let $U = X \setminus \overline{\{x\}}$. Since $W \to \Spec(\mathcal{O}_{X, x})$ is an isomorphism over the punctured spectrum, we may assume $b : X' \to X$ is an isomorphism over $U$. Thus we may and will think of $U$ as an open subscheme of $X'$ as well. Set $f' = f \circ b : X' \to \Spec(A)$. \medskip\noindent Since $A$ is regular we see that $\mathcal{O}_Y$ is a dualizing complex for $Y$. Hence $f^!\mathcal{O}_Y$ is a dualzing complex on $X$ (Duality for Schemes, Lemma \ref{duality-lemma-shriek-dualizing}). The Cohen-Macaulay locus of $X$ is open by Duality for Schemes, Lemma \ref{duality-lemma-dualizing-module-CM-scheme} (this can also be proven using excellency). Since $\mathcal{O}_{X, x}$ is Cohen-Macaulay, after shrinking $X$ we may assume $X$ is Cohen-Macaulay. Observe that an \'etale morphism is a local complete intersection. Thus Duality for Schemes, Lemma \ref{duality-lemma-fundamental-class-almost-lci} applies with $r = 0$ and we get a map $$ \mathcal{O}_X \longrightarrow \omega_{X/Y} = H^0(f^!\mathcal{O}_Y) $$ which is an isomorphism over $X \setminus \overline{\{x\}}$. Since $\omega_{X/Y}$ is $(S_2)$ by Duality for Schemes, Lemma \ref{duality-lemma-shriek-over-CM} we find this map is an isomorphism by Divisors, Lemma \ref{divisors-lemma-check-isomorphism-via-depth-and-ass}. This already shows that $X$ and in particular $\mathcal{O}_{X, x}$ is Gorenstein. \medskip\noindent Set $\omega_{X'/Y} = H^0((f')^!\mathcal{O}_Y)$. Arguing in exactly the same manner as above we find that $(f')^!\mathcal{O}_Y = \omega_{X'/Y}[0]$ is a dualizing complex for $X'$. Since $X'$ is regular the morphism $X' \to Y$ is a local complete intersection morphism, see More on Morphisms, Lemma \ref{more-morphisms-lemma-morphism-regular-schemes-is-lci}. By Duality for Schemes, Lemma \ref{duality-lemma-fundamental-class-lci} there exists a map $$ \mathcal{O}_{X'} \longrightarrow \omega_{X'/Y} $$ which is an isomorphism over $U$. We conclude $\omega_{X'/Y} = \mathcal{O}_{X'}(E)$ for some effective Cartier divisor $E \subset X'$ disjoint from $U$. \medskip\noindent Since $\omega_{X/Y} = \mathcal{O}_Y$ we see that $\omega_{X'/Y} = b^! f^!\mathcal{O}_Y = b^!\mathcal{O}_X$. Returning to $W \to \Spec(\mathcal{O}_{X, x})$ we see that $\omega_W = \mathcal{O}_W(E|_W)$. By Lemma \ref{lemma-characterize-rational-singularity} we find $E|_W = 0$. This means that $f' : X' \to Y$ is \'etale by (the already used) Duality for Schemes, Lemma \ref{duality-lemma-fundamental-class-lci}. This immediately finishes the proof, as \'etaleness of $f'$ forces $b$ to be an isomorphism.