Can you function both sides of an equation? So i had this question on my exam recently:
Given that: $g(x)= x +\ln x -1$ , $x>0$ ,(obviously $g$ is $1:1$)
$f(f(x))= f(x) + x + \ln x -1$   (1) , true for every $x>0$
prove that:

*

*$f$ is $1:1$ (which i easily proved with monotony , no problem here)

*$f^{-1}(1) = 1$

*the equation $f(x) = x$ , $x>0$ is only true for $x=1$
so here's how i tackled the third one: $f(x) = x \Leftrightarrow f(f(x)) = f(x) \Leftrightarrow f(f(x)) - f(x) = 0 $
from (1): $ x + \ln x -1 = 0 \Leftrightarrow g(x) =0 \Leftrightarrow g(x) = g(1) \Leftrightarrow x=1$ since $g$ is $1:1$
so the equation is true for $x=1$, and since $f$ is monotonous ( or $1:1$) $x=1$ is the only root of the equation
My professor said that this solution is false because " I cannot function both sides of an equation because the equation is not true for all $x\in Df$" . I really don't see how what my professor said is relevant at all and I'm honestly really confused. Any ideas?
EDIT: I asked my professor again and it seems that his real problem was that, according to him, i cannot function an equation that might not have a solution to begin with. I disagree with that observation because even if the equation is not true for all x>0 , provided everything in my solution is equivalent to each other, the equation will just turn out to be impossible. I also showed my solution to two other professors at my school and they agreed with it.
 A: First, let me present a solution for the question.
For the second part, observe that $f(f(1)) = f(1) + g(1) = f(1)$. Since f is one-to-one, $f^{-1}$ exist, so you can calculate $f^{-1}(f(f(x)))$ for $x=1$.
$$f^{-1}(f(f(1))) = f^{-1}(f(1)) = 1$$
For the last part, suppose, for absurd, that $f(x_0) = x_0$ for some $x_0 >0$ with  $x_0\neq 1$.
In this case, you have, for that:
$$f(f(x_0)) = f(x_0) + g(x_0)$$
$$f(x_0) = x_0 + g(x_0)$$
Which should be equal to $x_0$, by hypothesis. But, since $g(x)$ is one-to-one, $x_0 + g(x_0)  = x_0$ is true only if $g(x_0) = 0$, which implies that $x_0 = 1$, which contradict the condition that $x_0 \neq 1$.
Now, with respect the error of your solution and your question about the application of the function in both sides of an equation.
Consider  that you have the equality $g(x) = h(x)$ for some $x \in \mathbb{R}$. $f(g(x)) = f(h(x))$ only if $g(x) \in D_f$. Moreover, for this step $f$ don't even need to be one-to-one.
For better understand this step, think about equivalence:
Suppose that $g(x) = h(x)$ and $g(x)$ is in the domain of $f$. Then $f(g(x))$ exist, and, obviously, $f(g(x)) = f(g(x))$; now if you substitute $g(x)$ by $h(x)$ in the RHS, you will obtain $f(g(x)) = f(h(x))$.
Now, to "un-function"  some equation of $f$ (that is, the implication in the opposite way), you must apply the inverse of $f$, and, in this case, the LHS (or the RHS) of your equation must be in the domain of $f^{-1}$. That is, if $f(g(x)) = h(x)$, then $f^{-1}(f(g(x))) = f^{-1}(h(x))$ (and, consequently, $g(x) = f^{-1}(h(x))$ ) only if f(g(x)) is in the domain of $f^{-1}$.
EDIT:
Back to your solution. Your chain of implication are not true. First, you should write the range of values of $x$ that you are considering in your equation. If you are considering all domain of $f$ in all sentences, then there is no problem in the three first implication $f(x) = x \iff f(f(x))=f(x) \iff f(f(x)) - f(x) = 0$. But notice that the last expression $f(f(x)) - f(x) = f(x) - f(x) = 0$, for all $x>0$, Which conflicts with the hypothesis that $f(f(x)) - f(x) = g(x)$. Is for that reason that your solution it is not correct.
You could fix it saying: let $S  = \{x : f(x) = x, for x>0\}$. Then say that, for every $x\in S$, $f(x) = x \iff f(f(x))=f(x)$. Following this direction, you will should be able to prove that $S = \{1\}$.
A: The problem is that function composition doesn't have to exist unless the domains and ranges are correct. For example if I consider a function between arbitrary sets $A$ and $B$ then $f:A \rightarrow B$ there is no assurance that $f \circ f$ exists. In fact it will only exist if the image $f(A) \subset A$. In this case since the range is $\mathbb{R}$ but the domain is only when $x>0$ and $\mathbb{R}$ is not a subset of the positive reals. This means $f(f(x))$ is not well-defined so you can't function both sides of the equation. Note that the composition being well-defined has nothing to do with being one-to-one, it's a consideration all on its own.
