Find all real functions that satisfy $f(xy+x)+f(y)=f(xy+y)+f(x)$. Can you please help me solve this problem?

Find all real functions that satisfy the functional equation $f(xy+x)+f(y)=f(xy+y)+f(x)$.

I should solve it using the following theorem:

Let $f:\mathbb R\to\mathbb R$ satisfy the Hosszu functional equation
$$f(x+y-xy)+f(xy)=f(x)+f(y)$$
for all $x,y \in \mathbb R$. Then there exists an additive function $A:\mathbb R \to\mathbb R$ and a constant $a\in\mathbb R$ such that $$f(x)=A(x)+a\text.$$

Any advice would be helpful. I tried putting $x=y=1$ but didn't know what to do next.
 A: Note that this functional equation requires continuity to have well-defined solutions. Otherwise, any function that satisfies Cauchy's functional equation also satisfies this, and there may be other pathological functions (I haven't found any yet though).
Now, if we assume $f$ is continuous, we have:
Firstly, we note that if $f(x)$ satisfies the equation, so does $f(x)+C$ for any real constant $C$. Thus, assume $f(0)=0$.
Let $P(x,y)$ denote the assertion $f(xy+x)+f(y)=f(xy+y)+f(x)$.
Lemma 1: $f(x) = x f(1)$ $\forall x \geq 0$
Proof: 
Let $x > y > 0$. Consider the sequence $y_0 = y$, $y_{n+1} = \frac{x^2+xy_n+y_n}{x+y_n+1}$. We note that $y_n$ is an increasing sequence with a limit of $x$.
$$P \left ( \frac{x-y_n}{x+y_n+1}, x+y_n \right ) \implies f(x-y_n)+f(x+y_n)=f(x-y_{n+1})+f(x+y_{n+1})$$
From this, we get $f(x-y_n)+f(x+y_n) = f(x-y)+f(x+y)$. Sending $n \to \infty$ and using continuity yields $f(x-y)+f(x+y)=f(2x) \; \forall x>y>0$. Thus, we get $f(x)+f(y)=f(x+y) \; \forall x, y >0, x\neq y$. Using continuity, we get $f(x)+f(y)=f(x+y) \; \forall x, y \geq 0$,s o $f(x)=xf(1)$. $_\square$
Lemma 2: $f(-x)=-f(x) \; \forall x$
Consider the sequence $x_0 = x$, $x_{n+1}=\dfrac{x_n}{x_n+1}$. Note that $x_n$ is a decreasing sequence tending to $0$.
$$P(x_n, -x_{n+1}) \implies f(-x_{n+1}) + f(x_{n+1}) = f(-x_n) + f(-x_n)$$. Thus, $f(-x_n) + f(x_n) = f(-x) + f(x)$. Sending $n \to \infty$ and using continuity yields $f(x)+f(-x) = f(0)+f(0)=0$. Thus, $f(-x)=-f(x)$. $_\square$.
Thus, we have $f(x)=ax$ for some constant $ \in \mathbb{R}$. Accounting in the original assumption, we have $f(x)=ax+b$, where $a,b \in \mathbb{R}$, for $f$ continuous.
A: I don't know if there is a shortcut using Hosszu's functional equation, but there's an easy way to prove that a function $ f : \mathbb R \to \mathbb R $ satisfies
$$ f ( x y + x ) + f ( y ) = f ( x y + y ) + f ( x ) \tag 0 \label 0 $$
for all $ x , y \in \mathbb R $, iff there is an additive function $ A : \mathbb R \to \mathbb R $ and a constant $ a \in \mathbb R $ such that $ f ( x ) = A ( x ) + a $ for all $ x \in \mathbb R $. It's easy to check that functions of this form satisfy \eqref{0}. We try to prove the converse.
Assume $ f : \mathbb R \to \mathbb R $ satisfies \eqref{0} for all $ x , y \in \mathbb R $. Let $ a = f ( 0 ) $ and define $ A : \mathbb R \to \mathbb R $ with $ A ( x ) = f ( x ) - a $. Then you'll have
$$ A ( x y + x ) + A ( y ) = A ( x y + y ) + A ( x ) \tag 1 \label 1 $$
for all $ x , y \in \mathbb R $. By definition, we have $ A ( 0 ) = 0 $. Letting $ y = 1 $ in \eqref{1} we get
$$ A ( 2 x ) + A ( 1 ) = A ( x + 1 ) + A ( x ) \tag 2 \label 2 $$
for all $ x \in \mathbb R $. Substituting $ y + 1 $ for $ y $ in \eqref{1} we have
$$ A ( x y + x + y + 1 ) = A ( x y + 2 x ) + A ( y + 1 ) - A ( x ) \tag 3 \label 3 $$
for all $ x , y \in \mathbb R $. As the left-hand side of \eqref{3} is symmetric in $ x $ and $ y $, we conclude
$$ A ( x y + 2 x ) + A ( y + 1 ) - A ( x ) = A ( x y + 2 y ) + A ( x + 1 ) - A ( y ) $$
for all $ x , y \in \mathbb R $, which using \eqref{2} simplifies to
$$ A ( x y + 2 x ) + A ( 2 y ) = A ( x y + 2 y ) + A ( 2 x ) \tag 4 \label 4 $$
for all $ x , y \in \mathbb R $. Substituting $ 2 x $ for $ x $ and $ \frac y 2 $ for $ y $ in \eqref{1} we have
$$ A ( x y + 2 x ) + A \left( \frac y 2 \right) = A \left( x y + \frac y 2 \right) + A ( 2 x ) $$
for all $ x , y \in \mathbb R $, which together with \eqref{4} show that
$$ A ( 2 y ) - A \left( \frac y 2 \right) = A \left( x y + 2 y \right) - A \left( x y + \frac y 2 \right) \tag 5 \label 5 $$
for all $ x , y \in \mathbb R $. Putting $ x = - \frac 1 2 $ in \eqref{5} yields
$$ A ( 2 y ) - A \left( \frac y 2 \right) = A \left( \frac 3 2 y \right) $$
for all $ y \in \mathbb R $, and hence using \eqref{5} we get
$$ A \left( x y + 2 y \right) = A \left( x y + \frac y 2 \right) + A \left( \frac 3 2 y \right) \tag 6 \label 6 $$
for all $ x , y \in \mathbb R $. Substituting $ \frac 1 2 \left( \frac { 3 x } y - 1 \right) $ for $ x $ and $ \frac 2 3 y $ for $ y $ in \eqref{6} gives us
$$ A ( x + y ) = A ( x ) + A ( y ) \tag 7 \label 7 $$
forall $ x \in \mathbb R $ and all $ y \in \mathbb R \setminus \{ 0 \} $. In particular, letting $ y = 1 $ in \eqref{7} we have $ A ( x + 1 ) = A ( x ) + A ( 1 ) $ for all $ x \in \mathbb R $. Thus, using \eqref{7} we have
$$ A ( x + y ) = A ( x + y + 1 ) - A ( 1 ) = A ( x ) + A ( y + 1 ) - A ( 1 ) = A ( x ) + A ( y ) $$
for all $ x \in \mathbb R $ and all $ y \in \mathbb R \setminus \{ - 1 \} $. As $ ( \mathbb R \setminus \{ 0 \} ) \cup ( \mathbb R \setminus \{ - 1 \} ) = \mathbb R $, that together with \eqref{7} proves that $ A $ is additive, and therefore $ f $ is of the desired form.
