# Showing inverse composed with function is $x$ for all $x$ in the domain.

Suppose that $f$ is an injection. Show that $f^{-1}(f(x))=x$ for all $x$ in $D(x)$, and $f(f^{-1}(y))=y$ for all $y$ in $R(f)$. I understand the algebra behind it, and can show this with a random one-to-one function, but don't know where to start such a general proof.

For the first half:
Let $f(x_1)=y_1$ and $f(x_2)=y_2$
$\rightarrow$ $f^{-1}(y_1)=x_1$ and $f^{-1}(x_2)=y_2$.
Using composition, $f^{-1}(f(x_1))=f^{-1}(f(x_2))$

-