Confusion while reading solution So the question is Let A be the set of all rationals other than 0 and 1. A function $f : A → \mathbb R$ has
the property that for all $x ∈ A$,
$f (x) + f(1 −1/x)= \log |x|$.
Compute the value of $f(2007)$.
I couldn't solve it so I went to the solution, which is:

Let $g : A → A$ be defined by $g(x) := 1 − 1/x$; the key property is
  that $g(g(g(x))= x$. The given equation rewrites as $f(x) + f(g(x)) =
> \log |x|.$ Substituting $x = g(y)$ and $x = g(g(z))$ gives the further
  equations $$f(g(y)) + f (g (g(y))) = \log |g(x)|\;\text{ and }f (g (g(z))) +
f(z) = \log |g(g(x))|.$$ 
  Setting $y$ and $z$ to $x$ and solving the
  system of three equations for $f(x)$ gives 
  $$f(x) = 0.5 (\log |x| − \log
|g(x)| + \log |g(g(x))|).$$
   For $x = 2007$, we have $g(x) = 2006/2007$
  and $g(g(x)) = −1/2006$ , so that we can get  $f(x)=2006/2007$.

However I don't really understand how can you set $y$ and $z$ to $x$ in the final step: if you plug it in the first equation of $x = g(y)$, won't it become $x=1-1/x$ which is only true for the solution in this equation? How come you can also use $x=2007$ in $$f(x) = 0.5 (\log |x| − \log |g(x)| + \log |g(g(x))|)?$$ 
I am really confused at this setting variables part. Explanation would be greatly appreciated!
 A: If still in doubt, write down $\,f (x) + f(1 −1/x)= \log |x|\,$ for:


*

*$x = 2007\,$: 


$$f(2007)+ \color{blue}{f(2006/2007)} = \log(2007)\tag{1}$$


*

*$x = 2006/2007\,$:


$$\color{blue}{f(2006/2007)}+ \color{red}{f(- 1/2006)} = \log(2006/2007)\tag{2}$$


*

*$x = -1/2006\,$:


$$\color{red}{f(-1/2006)}+ f(2007) = \log(1/2006)\tag{3}$$
Then eliminate $\,\color{blue}{f(2006/2007)}\,$ and $\,\color{red}{f(- 1/2006)}\,$ between the $3$ equations to calculate $\,f(2007)\,$.
A: What the solution means to say is as follows:
We have $\forall x \in A$, $f(x) + f(g(x)) = \log|x|$. Given a particular $x \in A$, we will also have $g(x) \in A$ and $g(g(x)) \in A$, so this equation applies to them as well; this gives a system of three equations: 
$$
\begin{align}
f(x) + f(g(x)) &= \log|x| \\
f(g(x)) + f(g(g(x)) &= \log|g(x)| \\
f(g(g(x))) + f(x) &= \log|g(g(x))|
\end{align}
$$
Adding the first a third equations and subtracting the second gives $$2f(x) = \log|x| + \log|g(g(x))| - \log|g(x)|$$
From here we can straightforwardly find $f(2007)$
A: There are some typing  errors such as $$f(x) + f(g(x)) =
> \log |x|.$$ and $$f(g(y)) + f (g (g(y))) = \log |g(x)|\;\text{ and }f (g (g(z))) +
f(z) = \log |g(g(x))|$$ which makes the reading almost impossible. 
You may try your own proof using the relation $ g(g(g(x)))=x$
to make sense of their method. 
