# Is the inverse of a function the reflection of the function about the line $y=x$?

So if we have

$f(x)$:

$y=x$ when $x \ne 1$ and

$y = 0$ when $x = 1$.

The inverse would be:

$y=x$ when $x \ne 0$ and

$y=1$ when $x = 0$

?

-
The easiest way to check is to see if $f^{-1}(f(x)) = x$. Does it? – Arkamis Oct 25 '12 at 21:19
it gives me 1 when y = 0 – Gladstone Asder Oct 25 '12 at 21:32
Answer to the question in the title is yes. – wnvl Oct 25 '12 at 21:35

Yep. You correctly switched $x$ and $y$ and solved for $y$, and then switched the domain and range.

-

It’s just a bit more complicated than reflecting the graph about the line $y=x$, because the result may not be the graph of a function any more. Note that if you take your original picture and perform the reflection, there are two points in the new picture with $x$-coordinate $0$, and none with $x$-coordinate $1$.

The elaborate way of describing the situation is: consider a function $f\colon X\to Y$, $X$ being the domain of the function, and $Y$ being the target space. There is a left inverse $g\colon Y\to X$ satisfying $g(f(x))=x$ for all $x\in X$, if and only if the original $f$ was one-to-one. And there is a right inverse $h\colon Y\to X$ satisfying $f(h(y))=y$ for all $y\in Y$ if and only if $f$ was onto $Y$.

Examples with $X=Y=\mathbb R$: the exponential function $\exp(x)=e^x$ is one-to-one but not onto, and has this left inverse $g$: if $t>0$, $g(t)=\ln(t)$, while if $t\le0$, $g(t)=17$. The function $\tan^*$ cooked up from the tangent by setting $\tan^*(x)=\tan(x)$ if $x$ is not an odd multiple of $\pi/2$, and $\tan^*((k+1/2)\pi)=0$ is onto, and has the right inverse $h=\arctan$, the usual inverse tangent function. Notice that $g$ is not a right inverse of the exponential function any more than $h$ is a left inverse of the hoked-up tangent function.

-

The reflection of a line along the $x$-axis is the inverse IF the inverse of the original function is defined. A function is invertible if it passes the horizontal line test (so that its inverse will pass the vertical line test).

-