Mathematically, I can define a square wave that has a distinct unique value for every time t, no need for a single time t to have multiple values:
F(t) = sign(cos(t))
Consider a transition point (say, t = pi/2). When t = pi/2, my square wave (voltage) is 0. Just before that, it's 1. Just after that, it's -1.
Thus, there are never multiple voltages at the same time. But there is an infinite rate of change, which is impossible in the real world.
Yes, I am aware of that, there are still discontinuities though, and it is a convergence issue. The heavyside approach is a convention, but a useful tool. sin works as well ofc. and many other things. IMHO - it is a discontinuous pulse train, not a "wave". The definition for a pure "function" calls for a 1 to 1 mapping from the domain and the co-domain and that of course would be violated in a theoretical perfect square "wave" as represented on audio sites. In the real world, one needs a dx, even if it is an infinitely small one - in that case, it is a function. Without a dx, it is not a function or is a function by convention only.
It's nitpicking, maybe, but many people object, rightly imho, to the staircase representation of a digitally sampled signal as it opens the door to misinterpretation.
I feel the "square wave" representation leads to the same type of misinterpretation. Here's the mathematically correct representation of the function you gave for the "square wave" - a bit different from what people usually picture in their mind.
Note: not trying to lecture or be pedantic in any way, and I am sure you are well aware of all this. But if the staircase representation should be criticized as it is rightly in that famous video, the square "wave" deserves the same treatment I think.