I am having trouble with a contradiction arising from some computation, and I cannot figure out at which point I make a mistake.
Consider a conformally flat metric $g_{\mu\nu}=e^{2\phi}\eta_{\mu\nu}$. Then, the ricci scalar of $g$ is not always 0, depending on $\phi$, as can be seen for example from the formulas here.
However, let us now consider a "conformal" change of variables $x'^\rho(x)$ such that, in the new coordinates, the metric is rescaled as such : $g'_{\mu\nu} = e^{-2\phi}g_{\mu\nu} = \eta_{\mu\nu}$. In other words, identify the conformal transformation which rescales the metric by $e^{-2\phi}$, and apply it as a change of variables.
However, since scalars remain unchanged under a change of variables (more precisely under a diffeomorphism), we should have that $R[g] = R[g'] = R[\eta] = 0$ (where $R[g]$ is the ricci scalar of the metric $g_{\mu\nu}$.
Now this is a problem since we saw that $R[g]$ need not be $0$ even if g is conformally flat. Thus the contradiction.
I don't understand at which step in my reasoning I have made a mistake. The only possibility that I see is that there isn't such conformal transformation that rescales the metric by $e^{-2\phi}$, except when the $\phi$ in question does not affect the Ricci scalar, but this seems very restrictive looking again at this.