Suppose a cylinder with radius r and height r is put on the ground.
Then, another cylinder with radius $\frac{1}{2r}$ and height r is placed on top of the initial cylinder.
After that, cylinders that have $\frac{1}{2}$ of the radius of the previous cylinder and the same height r are placed on top of each other.
The result is that the total volume of the cylinders is equal to the volume of a sphere with radius r.
Here is my approach:
$$V_{cylinder} = \pi r^2h$$ $$h=r$$ $$V_{cylinder} = \pi r^3$$ $$\displaystyle V_{tot,cylinders} = \sum_{n=0}^{\infty}\left(\frac{1}{2}\right)^{2n}\pi r^3 = \frac{4}{3}\pi r^3 = V_{sphere}$$ Am I doing this correctly?


Seems to be fine.
It works because of the geometric sum
$$\sum_{i=0}^\infty \frac{1}{2^{2n}}=\sum_{i=0}^\infty \frac{1}{4^{n}}=\frac{1}{1-\frac14}=\frac43$$
Remark:
When you write $V_{cylinder}$, you might like to mention which one are you referring to.