设g(x) = f(x)-x.
有g(x)在[a,b]连续,g(a) = f(a)-a > 0,g(b) = f(b)-b < 0.
由连续函数的介值定理,存在c∈(a,b)使g(c) = 0.
可知c满足f(c) = c,故f(x) = x在(a,b)内有实根.
若f(x) = x在(a,b)内有两个不等实根,设f(c) = c,f(d) = d,且c < d.
g(x)在[c,d]上连续,在(c,d)内可导,并有g(c) = 0 = g(d).
由Rolle定理,存在ξ∈(c,d)使g'(ξ) = 0,即有f'(ξ) = 1,与条件矛盾.
故f(x) = x在(a,b)内实根唯一.