An equation of rational functions: $f(x)f(x+1)=\frac{g(x+1)}{g(x)}$ I'm trying to get the set of solutions of the following equation, whose unknowns are the rational functions $f$ and $g$ :
$\forall x\in\mathbb{R}$ such that the LHS and RHS are both defined, $$f(x)f(x+1)=\frac{g(x+1)}{g(x)}$$
$\bigl(f(x):=1, g(x):=1\bigr)$ is an example of a trivial solution to the equation. Now I'm trying to characterize the entire set of solutions.
Since $f$ and $g$ are rational functions, we can write them as $f(x)=\frac{P_1(x)}{Q_1(x)}$ and $g(x)=\frac{P_2(x)}{Q_2(x)}$, with $P_1, P_2, Q_1, Q_2\in\mathbb{R}[X]$.
So this equation is equivalent to finding the set of polynomials $P_1, P_2, Q_1, Q_2$ such that:
$$\forall x,\hspace{6pt}\frac{P_1(x)P_1(x+1)}{Q_1(x)Q_1(x+1)}=\frac{P_2(x+1)Q_2(x)}{P_2(x)Q_2(x+1)}$$
I don't really have any ideas as of how to move forward...
Any suggestion?
 A: A fairly broad (sub?)set of solutions is given by the following obvious formula (updated): $$f(x)={R(x+1)\over R(x)},\\[4ex]
g(x)={R(x)\cdot R(x+1)}
$$
where $R(x)$ is an arbitrary rational function.

 All previous iterations of this answer seem to have been covered by this formula.

A: Edit: The answer has been modified following a comment of Harmonic Sun and to include a second, simpler proof.
Any solution is essentially of the form in Ivan Neretin's answer:
$$ f(x)=\pm\frac{R(x+1)}{R(x)},g(x)=\pm R(x+1)R(x), $$ 
where $R(x)$ is an arbitrary rational function. Observe that if a solution $f,g$ with complex coefficients is given we construct $R$ 
with complex coefficients such that $ f(x)=\pm\frac{R(x+1)}{R(x)},g(x)=R(x+1)R(x).$
Proof: I will first work in the complex setting and then consider the real case.
For a rational function $h$ and some complex $\mu$, we define $v(h,\mu)=m$ if $m$ the multiplicity 
of $x-\mu$ as a factor of $h$. Recall that any rational function can be written as $c\prod_{j=1}^r (x-\mu_j)^{m_j}$.
For a rational function $h$ we denote by $h^+$ the one with $h^+(x)=h(x+1)$.
Then clearly $v(h^+,\mu-1)=v(h,\mu)$ for all $h$, $\mu$ and $v(hr,\mu)=v(h,\mu)+v(r,\mu)$, $v(h/r,\mu)=v(h,\mu)-v(r,\mu)$ for all $h,r,\mu$.
We introduce another notation for rational functions $h$ and complex $\mu$: 
$$S(h,\mu)=\sum_{k=-\infty}^\infty v(h,\mu+k).$$ 
Observe that the sum is essentially finite, that is only a finite number
of terms is non-zero. We have $S(h^+,\mu)=S(h,\mu-1)=S(h)$ for all $h$, $\mu$ and $S(hr,\mu)=S(h,\mu)+S(r,\mu)$, 
$S(h/r,\mu)=S(h,\mu)-S(r,\mu)$ for all $h,r,\mu$.
Now we consider two rational functions $f,g$ such that
$$f(x)f(x+1)=\frac{g(x+1)}{g(x)}.$$
Claim 1: $S(f,\mu)=0$ for all $\mu$.
Proof: we calculate on the one hand $S(ff^+,\mu)=S(g^+/g,\mu)=S(g^+,\mu)-S(g,\mu)=0$, on the other hand
$S(ff^+,\mu)=S(f,\mu)+S(f^+,\mu)=2S(f,\mu)$.
Claim 2: There exist a rational function $R(x)$ and a constant $c\in\{\pm1\}$ such that $f(x)=c\frac{R(x+1)}{R(x)}$.
$\renewcommand{\Re}{\mbox{Re}\,}$
Proof: We consider the finite set $M$ of complex numbers $\mu$ such that $0\leq \Re\mu<1$ and there exists
an integer $m$ such that $v(f,\mu+m)\neq0$. Then $\beta,\tilde\beta$ with $v(f,\beta)\neq0$ and $v(f,\tilde\beta)\neq0$
such that $\tilde\beta-\beta$ is an integer are associated to only one element of $M$.
We write
$$f(x)=c\prod_{\mu\in M}\prod_{k=-\infty}^\infty (x-\mu-k)^{m_{\mu,k}}$$ 
with some constant $c$ and integers $m_{\mu,k}$. Again, only a finite number of $m_{\mu,k}$ is nonzero
and, interpreting $(x-\alpha)^0=1$ as usual, the product is essentially finite.
Consider now for $\mu\in M$ the integers $n_{\mu,k}=\sum_{\ell=-\infty}^{k-1} m_{\mu,\ell}$ for $k\in\mathbb{Z}$.
By Claim 1, we have $\sum_{k=-\infty}^\infty m_{\mu,k}=0$ for all $\mu\in M$ 
and therefore $n_{\mu,k}$ is non-zero only for a finite number of $k$. 
Therefore 
$$R(x)=\prod_{\mu\in M}\prod_{k=-\infty}^\infty (x-\mu-k)^{n_{\mu,k}}$$
defines a rational function.
By construction, we have
$n_{\mu,k+1}-n_{\mu,k}=m_{\mu,k}$ for all integers $k$. Since
$$R(x+1)=\prod_{\mu\in M}\prod_{k=-\infty}^\infty (x+1-\mu-k)^{n_{\mu,k}}=
    \prod_{\mu\in M}\prod_{k=-\infty}^\infty (x-\mu-k)^{n_{\mu,k+1}},$$
we calculate 
$$c\,R(x+1)/R(x)=c\prod_{\mu\in M}\prod_{k=-\infty}^\infty (x-\mu-k)^{n_{\mu,k+1}-n_{\mu,k}}=
c\prod_{\mu\in M}\prod_{k=-\infty}^\infty (x-\mu-k)^{m_{\mu,k}}=f(x).$$
This proves Claim 2 except for the determination of the constant $c$.
Observe here, that $\frac{g(x+1)}{g(x)}$ can be written as a product of powers
$(x-\mu)^k$ without a leading constant factor, i.e. leading factor 1. Since $f(x+1)f(x)=\frac{g(x+1)}{g(x)}$,
the same is true for $f(x+1)f(x)$. Now this constant factor is also $c^2$. Hence $c^2=1$
and therefore $c\in\{\pm1\}$.
Claim 3: Any $R(x)$ from Claim 2 satisfies $g(x)=\lambda\,R(x+1)R(x)$ with some constant $\lambda$.
Proof: We calculate $f(x)f(x+1)=\frac{R(x+2)}{R(x)}=\frac{h(x+1)}{h(x)}$ where $h(x)=R(x)R(x+1)$.
Since also $f(x)f(x+1)=\frac{g(x+1)}{g(x)}$, the quotient $q(x)=\frac{g(x)}{h(x)}$ satisfies
$1=\frac{q(x+1)}{q(x)}$ or $q(x+1)=q(x)$. Since $q(x)$ is a rational function, this is only possible
if it is a constant, say $q(x)=\lambda$. Hence $g(x)=\lambda R(x)R(x+1)$.
In the complex setting, we can now choose a complex $\gamma$ such that $\gamma^2\lambda=1$. Replacing $R(x)$
by $\gamma R(x)$ provides $R$ such that $f(x)=\pm R(x+1)/R(x)$ and $g(x)=R(x+1)R(x)$.
This completes the proof in the complex setting. In the real setting, the essential consideration is to make sure that given real rational $f,g$, the construction of the proof of Claim 2 leads to a real rational $R(x)$. Now if $f(x)$ is real, then $\mu\in M$ if and only if the conjugate $\bar\mu\in M$ and the multiplicities $m_{\mu,k}=m_{\bar\mu,k}$ coincide. The same relation then holds for the multiplicities $n_{\mu,k}$ in the construction of $R(x)$. This implies that $R(x)$ also is a real rational function.
Claim 3 also holds in the real setting. Then the only difference to the complex case is that we have to take the sign of
$\lambda$ into account and therefore can reach either $g(x)=R(x+1)R(x)$ or $g(x)=-R(x+1)R(x)$.
Second Proof: (Only in the real setting) Consider the rational function $q(x)=g(x)/f(x)$. Using the functional equation of $f,g$, it satisfies 
$$\frac{q(x+1)}{q(x)}=\frac{g(x+1)f(x)}{f(x+1)g(x)}=f(x)^2,\ \ \ q(x+1)q(x)=\frac{g(x+1)g(x)}{f(x+1)f(x)}=g(x)^2.$$
If we can show that $q(x)$ is essentially a square, that is there exists a rational $R(x)$ such that $q(x)=R(x)^2$ or $q(x)=-R(x)^2$, 
then we are done.
In order to show that, we use the valuation function $v$ introduced in the first proof. For any complex $\mu$, we calculate
using $g(x+1)/f(x+1)=f(x)g(x)$
\begin{equation}\begin{array}{rcl}v(g/f,\mu+1)&=&v({g^+}/{f^+},\mu)=v(fg,\mu)=v(g,\mu)+v(f,\mu)\\&\equiv& v(g,\mu)-v(f,\mu)=v(g/f,\mu)\mod 2.\end{array}\end{equation}
Therefore all the integers $v(q,\mu+m)$, $m\in\mathbb Z$, are congruent modulo 2. As these integers are $0$ for suffiently large $m$,
they must all be even. This allows the construction of the wanted $R(x)$.
Indeed, if 
$$q(x)=\alpha\prod_{\mu\in\mathcal M}(x-\mu)^{2m_\mu},$$
where $\alpha$ is a real number and $\mathcal M$ denotes the finite set of $\mu$ such that $v(q,\mu)=2m_\mu\neq 0$,
then we can choose $\beta$ such that $\alpha/\beta^2\in\{\pm1\}$ and define $R(x)=\beta\prod_{\mu\in\mathcal M}(x-\mu)^{m_\mu}$.
Since $q$ has real coefficients, $\mu\in\mathcal M$ if and only if $\bar\mu\in\mathcal M$ and we have $m_\mu=m_{\bar\mu}$.
This implies that $R(x)$ also has real coefficients. It satisfies $q(x)/R(x)^2\in\{\pm1\}$ and our statement follows.
