Let $f(x) = \begin{cases} k(x) &\text{if }x>2, \\ 2+(x-2)^2&\text{if }x\leq2. \end{cases}$
Find the function $k(x)$ such that $f$ is its own inverse.
I know that $y=x$ is a function that is its own inverse. However, we have $2+(x-2)^2$ for $x\leq2$. I have found the inverse of $2+(x-2)^2$ to be $2+\sqrt{-2+x}$. When I graph this function, it looks like $k(x)$ in fact is $2+\sqrt{-2+x}$. I am not sure if $2+\sqrt{-2+x}$ is the correct answer though. Help is greatly appreciated.
Hint:
Note that all $x\leq 2$ have images in the range $[2,\infty)$
By using the relation $f(x)=f^{-1}(x)$ and Hint 1, you can find $k$