Let $ ABCD $ be a square with side length $ a $. Let $ s $ be a staircase from $ A $ to $ C $ with total length $ l $ and number of steps $ n $. It consists of perpendicularly alternating lines of length $ \frac{a}{n} $, as pictured here.
We see that $ l $ can be expressed as follows: $$ l = \frac{a}{n} \cdot n + \frac{a}{n} \cdot n = \frac{a}{n} \cdot n \cdot 2 = 2a $$ and as such stays constant at $ 2a $.
Now let us imagine that the amount of steps is infinite, e.g. $ n = \infty $. Per definitionem, the staircase should now be the diagonal of the square with length $ l=a\sqrt{2} $ according to Pythagoras. This is paradoxical! According to the equation pictured above, it should have the length $ 2a $, not $ a\sqrt{2} $.
My question is:
Does $ l $ equal to $ 2a $ or $ a\sqrt{2} $?
This is not paradoxal. The total staircase distance is, as you have shown, of length $2a$. However, this does not mean that the diagonal distance is the same.
No matter how small a right-angled triangle you take (in this case as $n \to \infty$), the hypotenuse (diagonal) will always be shorter than the sum of the other two sides (staircase).
Hence for an isosceles right-angled triangle of length $\frac an$, the hypotenuse is $$\sqrt{\left(\dfrac an\right)^2+\left(\dfrac an\right)^2}=\dfrac an \sqrt2.$$ Multiply this by $n$ and you get $a\sqrt2$, which is not equal to $2a$.