Let $z \neq 1$ be a complex number. Then \begin{align} \frac{1}{1-z} = \sum_{n=0}^{\infty} z^n. \end{align}
We have \begin{align} \frac{z^{-1}}{1-z^{-1}} = \sum_{n=1}^{\infty} z^{-n}. \end{align}
If we add the left hand sides of the two equations, then we have \begin{align} \frac{1}{1-z} + \frac{z^{-1}}{1-z^{-1}} = 0. \end{align} If we add the right hand sides of the two equations, then we obtain \begin{align} \sum_{n = - \infty}^{\infty} z^n. \end{align} Therefore when $z \neq 1$, we have $\sum_{z=-\infty}^{\infty} z^n= 0$. Do we have $\delta(z) = \sum_{n=-\infty}^{\infty} z^n$? How to understand the delta function and analytic continuation? Any help will be greatly appreciated!
You can get something like that only in some kind of distributional context. As distribution, you can write, as one version $$ \sum_{n\in\Bbb Z}z^n=\lim_{q\to 1-0}\sum_{n\in\Bbb Z}q^{|n|}z^n =\lim_{q\to 1-0}\frac{1-q^2}{1-q(z+z^{-1})+q^2} $$ which for $|z|=1$ and away from $z=1$ converges to zero while the integral over the unit circle always evaluates to $2\pi i$. Which is the condition for any sequence approximating (a multiple of) the delta distribution.
In the end, regardless of how one sets up the test functions and pairing with them, this identity amounts to one classical fact:
The pairings with the $z^n$ produce (multiples of) the Fourier series coefficients, and the series summation gives the evaluation of the Fourier series at $z=1$ resp. $t=0$ for $z=e^{it}$.
Standard reference for this topic: Carl Offner: A little harmonic analysis