Let $a,b\in\mathbb{R},~a<b$ and consider $f\colon[a,b]\to [a,b]$ continuous. Show that $f$ has a fixed point. i.e. that there exists a $\xi\in [a,b]$ with $f(\xi)=\xi$.
My idea is to consider the function $$ g\colon [a,b]\to [a-b,b]\subseteq\mathbb{R}, g(x):=f(x)-x. $$ This function is continuous on $[a,b]$, so I can apply the Intermediate Value Theorem (IVT), saying that for $0\in [a-b,b]$ there exists a $z\in [a,b]$ with $h(z)=0$.
Because $$ f(\xi)=\xi\Leftrightarrow h(\xi)=0 $$ it is $f(z)=z$.
The original statement is trivial if $f(a)=a$ or $f(b)=b$. Otherwise, $f(a)>a$ and $f(b)<b$, so $g(a)>0$ and $g(b)<0$. Now you can use the IVT as you suggested (but you want to replace $h$ with $g$ or the other way around). Also, $g$ as you defined maps to $[a-b,b-a]$, not $[a-b,b]$.