With DC coupling, the oscilloscope properly indicates the shape of the square wave coming from the signal generator.

oscilloscope indicates shape of square wave coming from signal generator