I'm assuming that you mean $A=\{x\in\mathbb{R}:x\geq 2\}=[2,\infty)$ and $B=\{y\in\mathbb{R}:y\geq 1\}=[1,\infty)$. In other words, $A$ is the set of real numbers greater than or equal to $2$ and $B$ is the set of real numbers greater than or equal to $1$. Instead of $A$ being a real number greater than or equal to $2$, any element of $A$ is a real number greater than or equal to $2$.
Now, consider the function $f(x)=x^2-4x+5$. This defines a parabola and the derivative of this function is $f'(x)=2x-4$. Therefore, the vertex of the parabola is at $x=2$. The value of the function at $x=2$ is $f(2)=1$. Moreover, for $x>2$, the derivative is positive (and increasing). Therefore, the image of $[2,\infty)$ is $[1,\infty)$.
Therefore, we have some hope of inverting the function because the function is onto and one-to-one (one-to-one because its derivative is positive except at $x=2$ and using the mean value theorem).
Starting with $y=f(x)$, you want to find a function so that $f^{-1}(y)=x$. In other words, we start with
$$
y=x^2-4x+5
$$
and want to solve for $x$. So, we rewrite this as
$$
0=x^2-4x+(5-y)
$$
Using the quadratic formula, we get
$$
y=\frac{4\pm\sqrt{16-20+4y}}{2}=\frac{4\pm\sqrt{4y-4}}{2}=2\pm\sqrt{y-1}.
$$
Since the codomain $B$ has values greater than or equal to $1$, the square root will never be a square root of a negative number. Now, since $A$ consists of real numbers greater than or equal to $2$, we want the inverse formula $y=2+\sqrt{y-1}$ because the other sign would result in numbers less than $2$.
Then $f^{-1}:B\rightarrow A$ is $f^{-1}(y)=2+\sqrt{y-1}$ and the domain is $B$ and the codomain is $A$.