g-C₃N₄ and graphene oxide (GO) are simultaneously introduced into electrospun polyacrylonitrile (PAN) nanofibers to form a nested structure. By Fourier transform infrared spectroscopy (FTIR) and X-ray photoelectron spectroscopy (XPS), g-C₃N₄ has been perfectly introduced into the PAN@GO nanofiber membrane and affects the porosity of the fiber itself. Comparison of nested electrospinning PAN/PAN@GO and different proportions of PAN@g-C₃N₄/PAN@GO nanofibers has a different effect on reducing the concentration and absorption of rhodamine B (RhB) dye in the visible region. Combined with the advantages of g-C₃N₄ and GO and the performance of fibers in the photocatalytic process, the optimal nested PAN@g-C₃N₄/PAN@GO nanofibers were selected. These results indicate that the nested PAN@g-C₃N₄/PAN@GO nanofibers with high photocatalytic activity have great potential in the treatment of printing and dyeing wastewater.