Square wave is the sum of the odd multiples of the main frequency (1 kHz in this case)
∑4{sin[(2n+1)π]/(2n+1)} whit n→∞
The inverting adder sums the n=32 signal.
Then only for the app's limits fmax is 63*fx=63 kHz, but it should tend to infinity.
You can see the Gibbs' peaks.