If a square wave has infinite bandwidth, how can we see it on an oscilloscope?
We can't. We see a bandlimited version. That's obvious for two reasons:

perfect square signals cannot physically exist, for changing a voltage within 0 time would require an infinite amount of power
Your oscilloscope has an analog front-end low-pass filter. Its bandwidth is probably printed somewhere prominent on the front panel.