A Variational Approach to the Yamabe Problem: Conformal Transformations and Scalar Curvature on Compact Riemannian Manifolds