I was watching this video from blackpenredpen where he solves the equation $\sqrt{5-x}=5-x^2$ by writing it in terms of "5". However, there's a comment with an alternate solution using functions that goes as follows:
Set $f(x) = 5 – x^2$ and $g(x) = \sqrt{5–x}$, then $f(g(x))=x$. Since $g(x) = f(x)$, this implies that $f(x) = x$, which is easy to solve because you can rewrite it as $5 – x^2 = x$.
Could someone explain (prove) why $\begin{cases} f(g(x))=x \\ f(x) = g(x)\end{cases} \implies f(x) = x$ ?
I really don't have any idea how to address this. Thanks in advance.
The comment meant to say that the solutions of the equation $f(x)=g(x)=f^{-1}(x)$ would be found when $f(x)=x$.
This is because the inverse of a function is its reflection in the line $y=x$. So, the point that lies on $y=x$ will remain intact. Ponder upon the statement. Maybe the graphs help you:
However, this logic fails if the function is already symmetric about $y=x$. For instance, solution to $f(x)=f^{-1}(x)$ for $f(x)=\frac1x$ is all real numbers.