If $f(x) = x^2 - 2x + 5$ what is $f^{-1}(x)$? 
If $f(x) = x^2 - 2x + 5$ what is $f^{-1}(x)$?
with the condition : $x > 1$

I solved this problem in this way:

$f(x) = x^2 - 2x + 5 -1 +1 \longrightarrow (x-2)^2 + 1 = f(x) $


$f^{-1}(x) = \sqrt{x-1} + 2$

But I saw someone else solved it in this way:

$f(x) = x^2 - 2x + 1 + 4  \longrightarrow  (x+1)^2 + 4 = f(x)  $


$f^{-1}(x) = \sqrt{x-4} + 1$

Which one is correct? If the second one is correct why mine is wrong?

After the edit, in the given interval $f(x)$ is bijective and hence invertible. But your method is incorrect because:
$$(x-2)^2+1=x^2-4x+5\neq f(x)$$
Your friend is right, but I believe in the second-last step you meant $f(x)=(x-1)^2+4$
