Prove that if a set $A \subset \mathbb R^n$ is connected, then it has the Intermediate Value Property.
Intermediate Value Property: let $f$ be a real-valued continuous function on a domain $A$ if $a,b \in A$ and $f(a)<c<f(b)$ , then $c \in f(A)$
I know that $A \subset \mathbb R^n$ is connected meaning there exist no disjoint, non empty, open sets $U$ and $V$ such that $A=U \cup V$. This means the function $f:A \to \mathbb R$ should be continuous on $A$. therefore, $A$ should have the Intermediate Value Property. but I don't know hwo to prove it formally.