Is it normal for the SQW pin of the DS3231 RTC module to not produce a proper square wave?
No. But the SQW output is open drain. Do you have a pullup resistor on that line?
The problem was solved when I added the pull-up resistor. Thank you very much for your help.