If $f$ is a continuous function on a closed interval, how can I show that there exists some $x$ on $f$ that $f(x)=x$?

I know it will require the Intermediate Value Theorem. Initially I thought of letting $g(x)=f(x)-x$, and showing that there exists $x$ such that $g(x)=0$ implying $f(x)=x$, but don't have any information about $f$ on either end of the interval.