Why rotating a function around line $y=x$ gives an inverse of this function? So I'm trying to read through a book on calculus on my own and there is a statement that if we have a graph of some function $y=f(x)$ and this is an injective function, then rotating it around the line $y=x$ gives a graph that is an inverse of that function. It is not proved in any way. So for me it sounds like some kind of mathemagical trick, that I can't get my head around. And apparently it works even on functions defined in an, I don't know how to call it, really "abstract" way (I mean that there is no equation defining the function so it's hard to find its inverse), like $y=\sin x$ for $-\frac{\pi}{2} \le x \le \frac{\pi}{2}$. (In a sense that rotating the function around the $y=x$ line gives a graph of $y = \arcsin x$). So, can anyone explain to me, what is going on "under the hood" of this strange procedure?
 A: Consider the abstract function $f$ and let $(x,y)$ be a point on its graph, so that $y = f(x)$.  The inverse function has the point $(y,x)$ in its graph.  We go from the one point to the other by swapping the coordinates.  This is equivalent to reflecting the graph through the line $y=x$ (which are the points that do not move under the reflection).
A: Let $M(x,f(x))$ a point on the curve of $f$ and let $M'$ its symmetric relative to the line $y=x$ then $M'(x',y')$ where $y'=x$ and $x'=f(x)$ so since $f$ is invertible we have
$$y'=f^{-1}\left(x'\right)$$
hence the curve of the function $f^{-1}$ is the symmetric of the curve of $f$ relative to the line $y=x$.
A: Suppose that $f$ and $g$ are mutually inverse functions.
The point $(a, b)$ is on the graph of the function $f$ if and only if $f(a) = b$ if and only if g(b) = a if and only if the point $(b, a)$ is on the graph of the function $g$.
So you need to convince yourself that the points $(a, b)$ and $(b, a)$ are reflections of one another across the line $y = x$.  What does that entail?
Check that the midpoint of the segment connecting the two points lies on the line $y = x$.  Specifically, note that the point
$$
\left( \frac{a + b}{2}, \frac{a + b}{2} \right)
$$
clearly lies on the reflection line and its distance from each of $(a, b)$ and $(b, a)$ is
$$
\tfrac{1}{\sqrt{2}} ( a - b )^2.
$$
