No, the preimage of a (pathwise) connected set under a continuous map has no reason to be connected. For examples, consider the projection $\pi \colon X\times Y \to X$ where $Y$ is a discrete space (with more than one point), or maps with discrete domain (these are automatically continuous).
I'm trying to prove that $GL_n(ℂ)$ is pathwise connected, without explicitly constructing paths.
Depending on what counts as explicit, we can prove it more or less easily.
First way, almost explicit paths:
Let $A \in GL_n(\mathbb{C})$. Consider $\varphi \colon \mathbb{C} \to M_n(\mathbb{C});\; \varphi(z) = (1-z)\cdot A + z\cdot I$. Then $p = \det \circ \varphi$ is a polynomial (of degree $\leqslant n^2$) with $p(0) \neq 0 \neq p(1)$, hence has only finitely many zeros. Choose a path $\gamma$ in $\mathbb{C}$ from $0$ to $1$ that avoids the zeros of $p$.
Then $\varphi \circ \gamma$ is a path in $GL_n(\mathbb{C})$ connecting $A$ and $I$.
That was easy.
Second way, no paths, but heavy machinery:
Definition: Let $D \subset \mathbb{C}^n$ open. A subset $E \subset D$ is thin in $D$ if it is locally contained in the zero set of a non-constant holomorphic function, i.e.
$$\bigl(\forall x\in D\bigr) \bigl(\exists U \in \mathcal{V}(x)\bigr) \bigl(\exists f \in \mathcal{O}(U)\setminus\{0\}\bigr)\bigl(E\cap U \subset Z(f)\bigr).$$
Proposition: Let $D \subset \mathbb{C}^n$ open and connected. Let $E \subset D$ thin in $D$. Then $D \setminus E$ is connected.
The proposition is proved in most (hopefully) books on several complex variables, for example, it's corollary 3.6 in chapter I of Range's "Holomorphic Functions and Integral Representations in Several Complex Variables".
Armed with that heavy machinery, we now observe that $E = M_n(\mathbb{C}) \setminus GL_n(\mathbb{C})$ is the zero set of a non-constant holomorphic function (the determinant), hence thin. Therefore $GL_n(\mathbb{C}) = M_n(\mathbb{C}) \setminus E$ is connected, since the vector space $M_n(\mathbb{C})$ is connected. $GL_n(\mathbb{C})$ is also open, hence it is pathwise connected.
Take $x_0\in f^{-1}(M)$, then $f(x_0)\in M$.
Since $M$ is open, there exists $r>0$ such that $B(f(x_0),r)\subset M$.
Now, choose any $0<\varepsilon\leq r$, since $f$ is continuous, there exists $\delta>0$ such that $f(x)\in B(f(x_0),\epsilon)$ whenever $x\in B(x_0,\delta)$.
Note that if $x\in B(x_0,\delta)$, then $f(x)\in B(f(x_0),\varepsilon)\subset M$, thus $f(x)\in M$, moreover, $x\in f^{-1}(M)$, thus $B(x_0,\delta)\subset f^{-1}(M)$, then $f^{-1}(M)$ is open.
Best Answer
Suppose the set $f^{-1}(U)=\{x\in\mathbb{R}:f(x)\in U\}$ is an open set. We want to see that $f$ is a continuous function, that is, for all $\varepsilon>0$ and $a\in\mathbb{R}$ there exists $\delta>0$ such that $|x-a|<\delta$ implies that $|f(x)-f(a)|<\varepsilon$.
Let $a\in\mathbb{R}$ and $\varepsilon>0$. Consider the set $U_{\varepsilon}=(f(a)-\varepsilon,f(a)+\varepsilon)$, which is open. Then $f^{-1}(U_{\varepsilon})=\{x\in\mathbb{R}:f(x)\in(f(a)-\varepsilon,f(a)+\varepsilon)\}$ is open on $\mathbb{R}$. Notice that $a\in f^{-1}(U_{\varepsilon})$. Thus, there exists $\delta$ such that $(a-\delta,a+\delta)\subset f^{-1}(U_{\varepsilon})$.
If $x\in (a-\delta,a+\delta)$ then $|x-a|<\delta$. Also, this implies that $x\in f^{-1}(U_{\varepsilon})$, which means that $f(x)\in(f(a)-\varepsilon,f(a)+\varepsilon)$; rewriting, $|f(x)-f(a)|<\varepsilon$. Therefore $f$ is continuous.