Mean value theorem understanding

So I have this question here which says:

Say that f is differentiable and $f'(x)\neq1$ on $(-\infty,\infty)$. Show that there is at most one real number $a$ such that $f(a)=a$

I'm supposed to use the mean value theorem with the function $g(x)=f(x)-x$ but i'm not really sure how I'm supposed to incorporated the mean value theorem into this...

I tried to substitute for $f(b)$ with $g(b)+b$ and simplify things but i'm not getting anywhere.

Any help on this please?


Solution 1:

Suppose to the contrary there are two distinct values such that $f(a)=a$, and $f(b)=b$.

The defining $g(x)=f(x)-x$, we get $g(a)=0$ and $g(b)=0$.

By Mean Value Theorem (Note $g$ is also differentiable):

$g'(c)=\frac{g(b)-g(a)}{b-a}=0$ for some $c$ between $a$ and $b$.

This means $0=g'(c)=f'(c)-1$, so $f'(c)=1$, a contradiction.

Solution 2:

It is not necessary to consider $g(x)=f(x)-x$.

Suppose that there are $a,b \in \mathbb R$ such that $b>a$, $f(a)=a$ and $f(b)=b$. Then

$\frac{f(b)-f(a)}{b-a}=1 \ne f'(c)$ for all $c \in (a,b)$, a contadiction