Today was the first day that I was introduced to the intermediate value theorem and I'm still quite unsure on how to use it to help solve some proofs. I've been given the following proofs to take care of:
[FIRST] Given $f: [0,1] \rightarrow \Bbb R$, so that $f([0,1]) \subset [0,1]$. With the help of intermediate value theorem, show that there exists an $x \in [0,1]$, s.t. $f(x) = x$.
I attempted to solve the above by saying that $f$ is continuous, therefore passes through each 'constant' curve ( where $f^{-1} = 0$ and $y = c$ ) and $min(f(0), f(1)) \le k \le max(f(0), f(1))$. Therefore, there exists $x \in [0,1]$, s.t. $f(x) = x$. But I'm unsure whether this is incomplete and believe that perhaps there is a better/thorough way to solve this proof.
[SECOND] For $f: \Bbb R$ \ {$0$} $\rightarrow \Bbb R$ is given the function $x \mapsto {1 \over x}$. It is valid that $f(-1) = -1 \lt 0$ and $f(1) = 1 \gt 0$. However, there exists no $x$ with $f(x) = 0$. Explain why this isn't a contradiction to the intermediate value theorem.
With this one, I thought it was because the 0 isn't included in the domain, but I'm unsure whether this is the right direction and if so, how to continue and strengthen my argument.
I hope someone can explain to me where I went wrong and why, as well as explain the best approach to both questions! Thank you!!
First part: If $f(0)=0$ or $f(1)=1$then we are done. So assume $f(0)\neq 0$ and $f(1)\neq 1$. Since the image of $f$ is a subset of $[0,1]$, this means that $f(0)>0$ and $f(1)<1$. Define $g(x)=f(x)-x$. As the difference of two continuous functions, $g$ is continuous (you didn't say $f$ is continuous in your question but I'm assuming you meant to). Now since $g(0)=f(0)-0>0$ and $g(1)=f(1)-1<0$, the intermediate value theorem implies that there exists $x$ such that $g(x)=0$. For this value of $x$, $f(x)=x$.
Second part: It is not a contradiction because $f$ is not continuous on any interval containing $-1$ and $1$. This is because it is not continuous (or even defined) at $x=0$.