Students are usually taught to find inverse functions using a procedure such as this from Stewart (Calculus, 2016, p. 58):
Question. Does the above procedure also prove that $f$ is invertible?
Let's take Stewart's example:
In the above example, have we also shown that $f$ is invertible? If so, at which step(s)?


Definition. A function $f$ is invertible if for any $a,b\in \text{Domain}\,f$, $$f(a)=f(b) \implies a=b.$$
Claim. Let $f$ be a function. Suppose we can find a function $g:\text{Range}\,f\rightarrow\text{Domain}\,f$ such that for every $x\in\text{Range}\,f$,
$$x=f\left(t\right) \implies t=g\left(x\right).$$
Then $f$ is invertible.
(Moreover, the function $g$ is the inverse of $f$.)
Proof. Let $a,b\in \text{Domain}\,f$. Suppose $f(a)=f(b)$.
Suppose we can find the function $g$. Then $g(f(a))=a$ and $g(f(b))$=b.
But since $g$ is a function and $f(a)=f(b)$, we have $a=b$. (Proof of moreover bit omitted.) ∎
Example. Define $f: \mathbb R \rightarrow \mathbb R$ by $f(x)=x^3+2$.
For each $x\in\text{Range}\,f$, there exists some $t\in\text{Domain}\,f$ such that
$$x=f(t)=t^3+2 \text{ or } t=\sqrt[3]{x-2}.$$
We've just shown there exists the function $g:\text{Range}\,f\rightarrow\text{Domain}\,f$ defined by $g(x)=\sqrt[3]{x-2}$ such that for every $x\in\text{Range}\,f$,
$$x=f\left(t\right) \implies t=g\left(x\right).$$
Hence, by the above Claim, $f$ is invertible. (Moreover, $g$ is the inverse of $f$.)