Catalysis of the reaction: D-glucose 6-phosphate = 1D-myo-inositol 3-phosphate. This reaction requires NAD, which dehydrogenates the CHOH group to CO at C-5 of the glucose 6-phosphate, making C-6 into an active methylene, able to condense with the aldehyde at C-1. Finally, the enzyme-bound NADH reconverts C-5 into the CHOH form.