TITLE: True or False : If $f(x)$ and $f^{-1}(x)$ intersect at an even number of points , all points lie on $y=x$
QUESTION [13 upvotes]: Previously I have discussed about odd number of intersect points (See : If the graphs of $f(x)$ and $f^{-1}(x)$ intersect at an odd number of points, is at least one point on the line $y=x$?)
Now , I want to know the even condition . For example $f(x) = \sqrt{x}$ and $f^{-1}(x) = x^2 , x\ge 0$ intersects each other in $(0,0)$ and $(1,1)$ points and these points located on $y=x$ line
Edit : Consider $f$ is continuous function.

REPLY [5 votes]: Assume that $f$ is a continuous and invertible real function with a connected domain.   Then $f$ is either strictly decreasing or strictly increasing over its domain (or it would assume some value twice, and would not be one-to-one).  Consider these two cases:

$f$ is decreasing.  Then, since $f(x)-x$ is also decreasing, $f$ can't cross $y=x$ more than once.  If it never crosses $y=x$, then it lies entirely above or below that line, and its inverse lies entirely on the other side; they never meet, and the theorem holds vacuously.  If, on the other hand, it crosses $y=x$ exactly once, then the total number of intersections between $f$ and $f^{-1}$ is odd, since off-diagonal intersections come in pairs.  The theorem holds in this case too.
$f$ is increasing.  Then it cannot intersect $f^{-1}$ at any point off the line $y=x$.  Suppose it did, at a pair of points $(x,y)$ and $(y,x)$ with $x<y$: then we would have $f(x)=y > x=f(y)$, contradicting the fact that $f$ is increasing.  In this case, then, all intersections are on $y=x$, and the theorem holds.

Since the theorem holds whether $f$ is increasing or decreasing, it is true in general.