Let $f: [0, 1] \to [0, 1] $ be continuous. Show that there is a point $x$ such that $f(x) =x$
Now the standard argument that one uses for a proof for this is to define $g(x) = f(x) - x$ and then use the Intermediate Value Theorem, but what happens in the case that $f(1) = 0$, then $g(1) = -1 \not\in [0, 1]$, how does one prove $g(x)$ is a well defined function, given that we have no idea how $f(x)$ is defined?
The function $g$ can have arbitrary codomain because the intermediate value theorem is right for every function $g:I \subset \mathbf R \to \mathbf R$.
The main thing to notice here is that $g(1)=f(1)-1 \leq 0$ and $g(0)=f(0) \geq 0$ since the values of $f$ are in $[0,1]$.