What you have is in fact a "local embedding" instead of a global embedding. You need to be slightly careful since different books may use different definition of "embedding" and "immersion". But anyway, now you have an immersion $f$ which is locally a diffeomorphism
$$M\overset{f}{\to} S^n$$
For a local embedding to fail to be a global one, you must have overlapped image, or equivalently have $f$ failing to be injective. This amounts to saying that $f$ must be a covering map of $S^n$, or equivalently $M$ is a covering space of $S^n$. This rules out the possibility of $S^1$ since its fundamental group is not trivial. Now for $n>1$, since it is well known that they have trivial fundamental group, therefore $f$ must be a 1-folded covering map, or equivalently a global embedding.
Please allow me to introduce another notation. Let $ \ m,n \in \mathbb{N}^*$, $M$ and $N$ be smooth manifolds with dimensions $ \, m \, $ and $ \, n \, $ respectively, $p \in M \ $ and $ \ f : M \to N \ $ be a smooth function such that $ \, f \, $ is a submersion at $ \, p$, ie, the differential $ \ df|_p : TM|_p \to TN|_{f(p)} \ $ is surjective. Clearly one has $ \ m \geqslant n$. The local submersion theorem says that there exists open sets $ \ U \subset M$, $V \subset N$, $Z \subset \mathbb{R}^{m-n} \ $ and $ \ W \subset \mathbb{R}^n \ $ and there exists charts $ \ x: U \to \mathbb{R}^m \ $ and $ \ y : V \to \mathbb{R}^n \ $ such that $ \ p \in U$, $f(p) \in f[U] \subset V$, $im(y) = W$, $im(x) = W \times Z \subset \mathbb{R}^{m-n} \times \mathbb{R}^n = \mathbb{R}^m \ $ and the local representation $ \ f_{xy} = y \circ f \circ x^{-1} : W \times Z \to W \ $ is of the form $$f_{xy} (a^1 , ... , a^m) = (a^1 , ... , a^n) \, ,$$ for all $ \ (a^1 , ... , a^m) \in W \times Z \subset \mathbb{R}^m$.
We can write this last equation as $$(y \circ f)(q) = f_{xy} \big( x(q) \big) = f_{xy} \big( x^1(q) , ... , x^m(q) \big) = \big( x^1(q) , ... , x^n(q) \big) = (x^1 , ... , x^n)(q) \, ,$$ for all $ \ q \in U \subset M$. Where we have the coordinate functions $ \ x = (x^1,...,x^m)$. So, in functional terms, we have $$y \circ f = (x^1 , ... , x^n) \, .$$
For each $ \ \mu \in \{ 1,...,m \}$, let $ \ \pi^{\mu} : \mathbb{R}^m \to \mathbb{R} \ $ be the projection onto the $\mu$-th coordinate, ie, $\pi^{\mu} (a^1,...,a^m) = a^{\mu}$, $\forall (a^1,...,a^m) \in \mathbb{R}^m$, and a restriction $ \ i^{\mu} = \pi^{\mu}|_{W \times Z} : W \times Z \to \mathbb{R}$, ie, $i^{\mu} (a^1,...,a^m) = a^{\mu}$, $\forall (a^1,...,a^m) \in W \times Z$. Then, the function $ \ i = (i^1,...,i^m) : W \times Z \hookrightarrow \mathbb{R}^m \ $ is the inclusion, ie, $i(a)=a$, $\forall a \in W \times Z$, and we have that $ \ im(i)= W \times Z$. So, we can write the above equality as $$f_{xy} = (i^1 , ... , i^n) \, . $$
Best Answer
Use "submersion" to conclude that the image of $F$ is open. Use "compact" to conclude that this image is closed. Use "connected" to conclude that this image is either all of $\mathcal Y$ or empty. Now either you're lucky and the source of this problem requires manifolds to be nonempty, or you need to add to the problem a hypothesis that $\mathcal X\neq\varnothing$.