We prove the pointwise equivalence between the Littelewood-Paley-Stein g-function of a semigroup and the martingale square function. This equivalence can also extend to the vector-valued and noncommutative settings. Our argument relies on the construction of a special symmetric diffusion semigroup associated with a martingale filtration. As an application, we obtain some optimal orders of the constants in the Littlewood-Paley-Stein inequality. We are also seeking for further applications to the vector-valued and noncommutative harmonic analysis.