The problem is as follows:
Consider a quantum field theory on a Lorentzian four-dimensional spacetime $(M,g)$ with action $S[\phi]$. Let $\mathcal{A}$ be the algebra of observables of the theory, and let $\mathcal{H}$ be the Hilbert space of the theory. We assume that the theory has a local gauge symmetry, generated by a Lie algebra-valued gauge field $A$.
Suppose that we perform a gauge transformation on the field $\phi$ by applying a gauge transformation operator $U(x)$ at each point $x\in M$. The gauge transformed field is given by $\phi'=U\phi$. Under this transformation, the gauge field transforms as $A'=UAU^{-1}+UdU^{-1}$.
We wish to show that the expectation value of the gauge transformed field $\langle\phi'\rangle$ is equal to the expectation value of the original field $\langle\phi\rangle$. In other words, we want to prove that gauge transformations do not change the physical predictions of the theory.
To prove this, we will use the path integral formalism and the Schwinger-Dyson equation. Recall that the partition function of the theory is given by $$Z=\int\mathcal{D}\phi,e^{iS[\phi]}.$$ The expectation value of an observable $O[\phi]$ is then given by $$\langle O\rangle=\frac{1}{Z}\int\mathcal{D}\phi,O[\phi]e^{iS[\phi]}.$$
Under a gauge transformation, the action transforms as $$S'[\phi']=S[\phi]+\int_M\text{Tr}(U^{-1}dU\wedge F),$$ where $F=dA+A\wedge A$ is the curvature of the gauge field. Thus, the partition function transforms as $$Z'=\int\mathcal{D}\phi',e^{iS'[\phi']}=\int\mathcal{D}\phi,e^{iS[\phi]+i\int_M\text{Tr}(U^{-1}dU\wedge F)}.$$
To prove that $\langle\phi'\rangle=\langle\phi\rangle$, we will use the Schwinger-Dyson equation, which states that for any operator $O[\phi]$, we have $$\frac{\delta\langle O\rangle}{\delta J(x)}=\langle O\frac{\delta S}{\delta\phi(x)}\rangle,$$ where $J(x)$ is an external source coupled to the field $\phi(x)$.
We can apply this equation to the gauge transformed field $\phi'$. Let $J'(x)$ be an external source coupled to $\phi'(x)$. Then \begin{align*} \frac{\delta\langle\phi'\rangle}{\delta J'(x)}&=\langle\phi'\frac{\delta S'}{\delta\phi'(x)}\rangle\ &=\langle U\phi\frac{\delta S}{\delta U\phi(x)}\rangle\ &=\langle U\phi U^{-1}\frac{\delta S}{\delta\phi(x)}\rangle\ &=\langle\phi\frac{\delta S}{\delta\phi(x)}\rangle\ &=\frac{\delta\langle\phi\rangle}{\delta J(x)}. \end{align*}
Since the Schwinger-Dyson equation holds for any external source $J'(x)$, we have $\langle\phi'\rangle=\langle\phi\rangle$, as desired.
Is this calculation correct, and is there any other way to prove gauge invariance in quantum field theory using the Schwinger-Dyson equation or other methods?
This looks correct to me. There are other ways to prove gauge invariance in quantum field theory. One way is to use the BRST formalism, which introduces additional ghost fields and an extended action to make gauge transformations manifestly non-physical. Another way is to use the Batalin-Vilkovisky formalism, which introduces antifields and a graded Poisson bracket to encode the gauge symmetry. Both of these formalisms are used to construct gauge-invariant perturbation theory in gauge theories.