Let $\beta(t) = (\sin 2t, \sin t) :(-\pi, \pi) \to \mathbb{R}^2$. This is an injective immersion and so its image $S$ is an immersed submanifold of $\mathbb{R}^2$ (the figure-eight). Let $G(t) = (\sin 2t, \sin t) : \mathbb{R} \to S$ where $S$ is with the topology and smooth structure as the immersed submanifold. The formula is the same with $\beta$, but the domain and codomain are different from those of $\beta$.
Example 5.28 of "Introduction to smooth manifolds" by J. Lee states that the map $G$ is not continuous because $\beta^{-1} \circ G$ is not continuous at $t = \pi$. In my understanding, $(\beta^{-1} \circ G)(\pi) = 0$ and the preimages of narrow intervals containing $0$ don't contain $\pi$, so it is not continuous there.
However, directly in terms of the open sets in $S$, I couldn't find any open set in $S$ whose preimage by $G$ is not open in $\mathbb{R}$. There must be such open sets in $S$ because $G$ is not continuous. What such open sets are there?