You can simplify your example even further, if you haven't previously assigned anything to x.
g[x_] = 1/(1 + x);
x = g[x]
or
g[x_] := 1/(1 + x);
x = g[x]
Both of these display the same run-away recursion errors.
You might think about the problem this way. You are assigning something to x. To do that you evaluate g[x]. To do that you look at the right hand side of the definition of g[x] and evaluate everything in that. Doing that means you need the value of x. What is the value of x? You look and see that x is g[x] and the process starts all over again and again and again.
If you think about it, can you then make any sense of this behavior?
While on the surface the notation used in the Mathematica programming language might look similar to other conventional programming languages, below the surface it is anything but this. Really understanding the depths and details of the evaluation process that Mathematica uses may be difficult, but might help explain some of the "more interesting" behaviors that you may run into with continued use.
If what you really want is just the result instead of trying to figure the behavior out then try this instead
g[x_] := 1/(1 + x);
Nest[g, x, 10]
and see if that was what you wanted to accomplish.