Function generator is an ungrounded device, so the internal circuitry will float to around half mains potential through the parasitic capacitances in the power supply. This will generate 300V peak to peak into a 10M input scope probe, just from the few pf of capacitance.
Solutions are to connect the FG output ground to the scope ground, either using a coax BNC lead to connect to an unused channel on the scope to an unused BNC connector on the function generator ( trigger, square wave output it does not matter as all you want is the shield of the cable to connect ground together on both devices with a low resistance), or to connect the FG ground to the scope ground by some other means, like a lead with crocodile clips both ends to metal of the spare BNC socket on FG and to scope ground connection.
Connecting fg ground to scope ground worked for me. All my readings are making sense now. Thanks again! Glad this riddle was solved!
Sent from my SM-G900P using Tapatalk