Suppose $A$ is the set of real numbers equal to or greater than 2, $B$ is the set of real numbers equal to or greater than 1, and the function $f: A \rightarrow B$ is defined by $f(x)=x^2-4x+5$. How can I find the inverse of the function and the domain and codomain of the inverse function?

The domain shouldn't be difficult - it should just be everywhere that it's defined, and if I differentiate the function I should be able to find critical point(s) and evaluate them with the inverse function to figure out the bounds of the domain.

So the only thing I'm really struggling with is inverting the function $f:A \rightarrow B$.