if $\ f(f(x))= x^2 + 1$ , then $\ f(6)= $? I want to know how to solve this type of questions.  How can I find $\ f(x)$ from $\ f(f(x))$
Suppose, $\ f(f(x)) = x$   , then $\ f(x)=x$ or $\ f(x)=\dfrac{(x+1)}{(x-1)}$ 
how to find these solutions..
I have found one.. $\ f(6) = \sqrt{222} $ 
Is this correct?

Here is a javascript function that conforms to the original poster's requirement that $f(f(x)) = x^2+1$. The original poster asked what is $f(6)$. This program computes that
$f(6)=12.813735153397387$
and
$f(12.813735153397387)=37$
QED we see $f(f(6)) = 6^2+1=37$
function f(x) {
  x<0 && (x=-x);
  return x==x+1 ? Math.pow(x, Math.sqrt(2)) : Math.sqrt(f(x*x+1)-1);
}

It is not known that the function $f(x)$ can be expressed in mathematical terms (closed-form). It may be the $f(x)$ implementation in javascript above could help in discovering such a closed-form solution. I only know that the above javascript code adheres to the OP's requirement that $f(f(x)) = x^2+1$ for all $-\infty<x<\infty$ insofar as javascript has finite precision.
I wrote the code, BTW. I am sharing it in the hopes that it will be useful.
Javascript can be executed in a browser sandbox, here is one (no affiliation):
https://jsconsole.com/
Here is the equivalent description of the function implemented above:
$f(x)=\begin{cases}f(-x)&x<0\\x^{\sqrt{2}}&x\approx x+1\\\sqrt {f(x^2+1)-1}\end{cases}$
I believe this function is the optimal solution for $f(f(x)) = x^2+1$ but I can't prove it.
