Let $f:\mathbb{R}\to\mathbb{R}$ continuous. Show that if $f(-1)<0$ and $f(1)>0$, then there exist $-1<a<1$ such that $f(a)=0$.
My approach: Suppose that $f(x)\neq 0$ for all $x\in (-1,1)$. Then $$f((-1,1))=(f(-1),0)\cup(0,f(1))\qquad\qquad(*)$$
Furthermore, $f$ is continuous and the image of connected set is connected, then (*) is a contradiction.
Therefore, must be exist some $a\in(-1,1)$ such that $f(a)=0$. This is correct? Can give me some hint. Thanks!
Just because $f(x) \neq 0$ on $x \in (-1,1)$ does not mean that $0$ is the only omitted value, which you assert via "$(f(-1),0) \cup (0,f(1))$"${} = (f(-1),f(1)) \smallsetminus \{0\}$. My age (in years) is continuous and has never been $-1$, but this does not mean that $-1$ is the only number my age can never be.