Find the function(s) $f:\mathbb{R}\setminus\{0\}\to\mathbb{R}\setminus\{1\}$, $f(xy)=f(x)f(-y)-f(x)+f(y)$, $f(f(x))=\frac1{f\left(\frac1x\right)}$ 
Find all the functions $f:\mathbb{R}\setminus\{0\} \to \mathbb{R}\setminus\{1\}$ which satisfy the two conditions:

*

*$f(xy)=f(x)f(-y)-f(x)+f(y)$ $\text{for } \forall x, y \in \mathbb R\setminus\{0\}$

*$f(f(x))=\dfrac 1 {f \left( \frac 1 x \right)} \text{ for } \forall x \in \mathbb R\setminus\{0, 1\} $

My expectation of the function $f$ is $f(x)=1-\dfrac 1 x$
My attempt:
\begin{align} 
&\text{if } f \equiv 0: \text{Solution}. \\ 
&\text{if } f \not\equiv 0: \\ 
\ \\ 
&P(x, x): f(x^2)=f(x)f(-x). \\ 
&x=1; \\ & f(1)=f(1)f(-1). \\ 
&\text{if } f(1) \neq 0: \\ 
&f(-1)=1 \not\in \mathbb{R}\setminus\{1\}. \\ 
&\therefore f(1)=0. \\ \ \\ 
&\text{let } t \text{ s.t. } f(t) \neq 0. \\ \ \\ 
&P(t, 1): f(t)=f(t)f(-1)-f(t)+f(1) \\ 
&\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =f(t)f(-1)-f(t). \\ 
&\Rightarrow f(-1)=2. \\
\ \\
&f(f(-1))=\dfrac {1} {f(-1)}. \\
&\therefore f(2)= \dfrac 1 2. \\
\ \\
& f(f(2))= \frac 1 {f \Big(\dfrac {1} {2} \Big)}. \Rightarrow f \Big( \dfrac{1}{2} \Big) = \pm 1. \Rightarrow f \Big( \dfrac 1 2 \Big) = -1.
\ \\
& P(-1, -\frac 1 2): f \Big( \frac 1 2 \Big) = f(-1)f\Big( \frac 1 2 \Big) - f(-1)+f\Big(-\frac 1 2 \Big). \\
&\Rightarrow -1=2 \cdot (-1)-2+f\Big(-\frac 1 2 \Big). \\
&\therefore f\Big( -\frac 1 2 \Big)=3. \\
\ \\
&P(x, 1): f(-x)=f(x)f(1)-f(x)+f(-1) = -f(x)+2. \\
&\therefore f(x)+f(-x)=2. \\
\ \\
&\text{Substituting for the first original F.E.: } f(xy)-1=(f(x)-1)(f(y)-1). \\
\ \\
&g(x) = f(x)-1. \\
&\Rightarrow -g(xy)=g(x)g(y). \\
&g(g(x)+1)+1= \dfrac 1 {g(\frac 1 x)+1}. \\
&\therefore g(g(x)+1)=-\dfrac {g(\frac 1 x)} {g(\frac 1 x)+1}.
\end{align}
 A: It's possible to show that $ f ( x ) = 1 - \frac 1 x $ gives the only injective solution.
Let's first look at the question a bit more generally. Consider an $ f : \mathbb R \setminus \{ 0 \} \to \mathbb R $ satisfying
$$ f ( x y ) = f ( x ) f ( - y ) - f ( x ) + f ( y ) \tag 0 \label 0 $$
for all $ x , y \in \mathbb R \setminus \{ 0 \} $. Putting $ x = 1 $ and $ y = - 1 $ in \eqref{0}, we get $ f ( 1 ) \in \{ 0 , 1 \} $. In case $ f ( 1 ) = 1 $, setting $ x = y = 1 $ in \eqref{0}, we get $ f ( - 1 ) = 1 $, which then letting $ y = 1 $ in \eqref{0} shows $ f ( x ) = 1 $ for all $ x \in \mathbb R \setminus \{ 0 \} $, which contradicts injectivity of $ f $. Hence $ f ( 1 ) = 0 $. Putting $ x = - 1 $ and $ y = 1 $ in \eqref{0}, we get $ f ( - 1 ) \in \{ 0 , 2 \} $. In case $ f ( - 1 ) = 0 $, setting $ y = 1 $ in \eqref{0} implies $ f ( x ) = 0 $ for all $ x \in \mathbb R \setminus \{ 0 \} $, which contradicts injectivity of $ f $. Thus $ f ( - 1 ) = 2 $. Letting $ y = - 1 $ in \eqref{0}, we have
$$ f ( - x ) = 2 - f ( x ) \tag 1 \label 1 $$
for all $ x \in \mathbb R \setminus \{ 0 \} $. \eqref{0} and \eqref{1} together imply
$$ f ( x y ) = f ( x ) + f ( y ) - f ( x ) f ( y ) \tag 2 \label 2 $$
for all $ x , y \in \mathbb R \setminus \{ 0 \} $. In particular, setting $ y = \frac 1 x $ in \eqref{2}, we have
$$ \bigl ( f ( x ) - 1 \bigr ) f \left ( \frac 1 x \right ) = f ( x ) \tag 3 \label 3 $$
for all $ x \in \mathbb R \setminus \{ 0 \} $. Note that for any $ x \in \mathbb R \setminus \{ 0 \} $, if $ f ( x ) \ne 0 $, then the left-hand side of \eqref{3} must be nonzero, and thus $ f ( x ) \ne 1 $. As we have $ y \ne 0 $ or $ y \ne 1 $ for any $ y \in \mathbb R $, we can conclude $ f ( x ) \ne 1 $ for all $ x \in \mathbb R \setminus \{ 0 \} $. Therefore, $ f $ takes values only in $ \mathbb R \setminus \{ 1 \} $, similar to what is posed in the original question. Knowing this, also note that for any $ x \in \mathbb R \setminus \{ 0 \} $, we have $ f \left ( \frac 1 x \right ) \ne 0 $ if $ f ( x ) \ne 0 $.
Before taking the second functional equation into account, note that the expression $ f \bigl ( f ( x ) \bigr ) $ only has meaning for those $ x \in \mathbb R \setminus \{ 0 \} $ for which $ f ( x ) \ne 0 $, as $ f ( x ) $ must be in the domain of $ f $. So, when stating that the second functional equation holds for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $, you're implicitly assuming that $ f ( x ) \ne 0 $ for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $. There's another implicit assumption, namely that $ f \left ( \frac 1 x \right ) \ne 0 $ for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $, because $ f \left ( \frac 1 x \right ) $ has appeared in the denominator. But we've proven that this requirement follows from $ f ( x ) \ne 0 $, and thus it is a consequence of the other mentioned assumption. So, let's assume that $ f $ satisfies
$$ f \bigl ( f ( x ) \bigr ) = \frac 1 { f \left ( \frac 1 x \right ) } \tag 4 \label 4 $$
for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $. By \eqref{3} and \eqref{4}, we have
$$ f \bigl ( f ( x ) \bigr ) = 1 - \frac 1 { f ( x ) } \tag 5 \label 5 $$
for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $. Taking $ f $ from both sides of \eqref{5} and comparing it with the result of substituting $ f ( x ) $ for $ x $ in \eqref{5}, we get
$$ f \left ( 1 - \frac 1 { f ( x ) } \right ) = f \Bigl ( f \bigl ( f ( x ) \bigr ) \Bigr ) = 1 - \frac 1 { f \bigl ( f ( x ) \bigr ) } $$
for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $, which using \eqref{5} shows
$$ f \left ( 1 - \frac 1 { f ( x ) } \right ) = \frac 1 { 1 - f ( x ) } \tag 6 \label 6 $$
for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $. Again, substituting $ f ( x ) $ for $ x $ in \eqref{6} and using \eqref{5}, we have
$$ f \left ( \frac 1 { 1 - f ( x ) } \right ) = f ( x ) $$
for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $, which by injectivity of $ f $ yields $ \frac 1 { 1 - f ( x ) } = x $, for all $ x \in \mathbb R \setminus \{ 0 , 1 \} $. As $ f ( 1 ) = 0 $, we have $ f ( x ) = 1 - \frac 1 x $ for all $ \mathbb R \setminus \{ 0 \} $.
