How can a ratio containing only real numbers have a complex value? Solving this equation
$$x = 1-\cfrac{2}{1-\cfrac{2}{1-\cfrac{2}{\ddots}}}$$
Sub in $x$
$$x=1-\frac{2}{x}\implies x^2=x-2 \implies x^2-x=-2$$
Solve through completing the square
\begin{align}
x^2-x+\frac{1}{4}&=-2+\frac{1}{4}\\
\left(x-\frac{1}{2}\right)^2&=-\frac74\\
x-\frac{1}{2}&=\pm\sqrt{\frac{7}{4}}i\\
x&=\frac{1}{2}\pm\sqrt{\frac{7}{4}}i\\
\end{align}
When you substitute this value back in for $x$ it works.
But i don't understand why a equation like this can equal a complex value
Maybe I am missing something important here?
EDIT: So this equation diverges right. Does that make my working invalid, or just explain the non-real part.
Can anything useful be done by defining this recursively
$$f(x)=1-\frac{2}{f(x)}$$
and then using a seed value
I also wonder whether we would end up dividing by zero at some point. Can you prove we do or don't?
 A: It is not strange at all.
Look at this:
$$x^2+1=0$$
This equation consists only of real coefficients (even only of integers) but still solutions are $i$ and $-i$. 
$$5x=3$$
A the coefficients are natural numbers, but the solution isn't, the solution is rational $3/5$
There are even identities in maths, where you have real numbers on the one side and complex on the other.  
For example Euler's identity:$$e^{πi}=-1$$
So it's completely ok to have equation with real coefficients and complex solutions. Also, remember that real numbers are also complex numbers.  
EDIT: I misunderstood your question a bit. You meant that we have only $x$ on the LHS and real number on RHS. Can you prove that number on the RHS is real ? How can you be convinced that number on the RHS even exists?    
EDIT: I was wrong about the fact that you need to prove that number on RHS is real, because, actually as all other commenters pointed out, you need to prove that number on the RHS converges. And to do so you need use definition of continued fraction.
A: A standard complex number is $z=a+bi$
Its complex conjugate $\bar{z}=a-bi$
Note for these two;
$$z+\bar{z}=2a\in\Bbb R$$
$$z\bar{z}=(a+bi)(a-bi)=a^2+b^2\in\Bbb R$$
Thus if we form an equation using:
$$(x-z)(x-\bar{z})=0$$
Then we get:
$$x^2-(z+\bar{z})x+z\bar{z}=0$$
For which we have already established the coefficients are real.
So it is entirely plausible for complex numbers to be the solution to equations seen only with real numbers. 
As Szeto's answer suggests, the presence of complex numbers as the solution, with no known way of getting them in the infinite fraction, tells us it is extremely likely that this continued fraction is divergent.
A: As Szeto and others remarked, you have a continued fraction. The most general form is
$$a_0 + \frac{b_1}{a_1 + \frac{b_2}{a_2 + \frac{b_3}{a_3 + ...}}} .$$
where $a_i, b_i \in \mathbb{Z}$. Usually one only considers the case that all $b_i = 1$ ("regular continued fractions"). Here we have $a_i = 1$ and $b_i = -2$.
Consider the sequence $x_n = [a_0;(b_1,a_1), ..., (b_n,a_n)]$ obtained by stopping the iteration of quotients with $a_{n-1} + \frac{b_n}{a_n}$. This sequence may converge or not. If your example would converge, then your computation would produce the correct result which is absurd since all $x_n$ are real. This proves that the sequence diverges.
A: I think none of the existing answers refer to the continued fraction, which looks real.
By simple calculations, the first few convergents of $\frac2{1-\frac2{1-\frac2\cdots}}$ are:
$$2, -2, \frac23,6,-\frac25,\frac{10}7,-\frac{14}3,\frac6{17},\frac{34}{11},-\frac{22}{23},\frac{46}{45},\mathbf{-90} ,\frac{2}{91},\frac{182}{89}$$
This suggests that the continued fraction diverges.
I am trying to come up with a rigorous proof.
EDIT:
Just to preserve @Quantaliinuxite valuable comment(which indeed can, alone, be a fabulous answer):

Actually the sheer fact that this sequence of real numbers should converge to complex number tell us that the sequence does not converge. It’s a basic result in real analysis that any sequence of real numbers which converges converges to a real number. This is true because the real line is closed. (Intuitively if it converges to some complex number which is not a real number (ie not zero) you could find a neighborhood of that complex number where all the points of your sequence belong for n big enough. But this can’t happen since all the points of our sequence are real. 

A: The simple answer is that this repeated fraction isn't convergent for any initial value. Here's a plot of the first thousand iterations of $f_n(x) = 1 - \frac 2 {f_{n-1}(x)}$. 
The animation shows how the plot changes for different values of $f_0$. As you can tell, it bounces around a lot. Here's what the first 200 values look like with a line drawn between them (using $f_0=0.001$):

The only stable values of the function are in the complex plane. And even in the complex plane, the function isn't exactly convergent (here the initial value is $f_0=1+i$:

Instead of converging to a single value, the output of the function "orbits" around one of the stable points. 
A: Let $x=f(x)$ where $f(x)=1-2/f(x)$. Then $\Im(x)=0$ since there are no imaginary parts. But $$x=f(x)\implies x^2-x+2=0\implies\Im(x)\neq 0.$$ Contradiction. Therefore $x$ does not exist.
