<s>[INST] How to rigorously prove the following continued fraction identity? The following identity seems to be satisfied for any $z \in C$
$$\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cdots}}}}=\begin{cases}1 & |z| \geq 1\\z^2 & |z| \leq 1\end{cases}$$
I checked it numerically for real and for complex numbers. 
If we assume that the limit exists, we have:
$$\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cdots}}}}=y$$
$$\cfrac{z^2}{1+z^2-y}=y$$
$$y_1=1,~~~~~~~y_2=z^2$$
This solution doesn't tell us when to use $y_1$ and when to use $y_2$.
I think I can prove the second solution for $|z| < 1$ by transforming the continued fraction into geometric series by Euler's formula:
$$\frac{1}{1-y}=\cfrac{1}{1-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cdots}}}}=1+z^2+z^4+z^8+\dots=\frac{1}{1-z^2}$$
But I'm not sure how to prove the case of $|z| \geq 1$.

Edit
Of course, I can use the same way for $|z| > 1$:
$$\frac{1}{1-\frac{y}{z^2}}=\cfrac{1}{1-\cfrac{\frac{1}{z^2}}{1+\frac{1}{z^2}-\cfrac{\frac{1}{z^2}}{1+\frac{1}{z^2}-\cdots}}}=1+\frac{1}{z^2}+\frac{1}{z^4}+\frac{1}{z^8}+\dots=\frac{1}{1-\frac{1}{z^2}}$$
$$y=1$$
And the case for $|z| = 1$ seems to be self-evident. Still, I'm not sure if those proofs are rigorous.
 [/INST] The convergents of this continued fraction are easy to compute explicitly:$$\underbrace{\cfrac{z^2}{1+z^2-\cfrac{z^2}{1+z^2-\cfrac{\ddots}{\ddots-\cfrac{z^2}{1+z^2}}}}}_{n\text{ numerators/denominators}}=\frac{z^2(1-z^{2n})}{1-z^{2n+2}}$$ (understood in the limit sense if $z^{2n+2}=1$, and proven by induction). Now taking $n\to\infty$ is as rigorous as one gets. This confirms your result for $|z|\neq 1$ and $z=\pm 1$; for other values of $z$, the limit doesn't exist.
</s>