I would like if you help me in this exercise in what I'm a little stuck:
Thinking of $S^1$ as the Equator in $S^2$, give an embedding of $\mathbb{R}P^1$ in $\mathbb{R} P^2$ but prove that $\mathbb{R} P^1$ is not the level set of any regular value of a smooth function $f:\mathbb{R} P^2\to \mathbb{R}$.
To give the embedding, I combined the diffeomorphism $\mathbb{R} P^1\to S^1$ induced by $z\mapsto z^2$, the embedding $\iota: S^1\to S^2$ given by $\iota(x,y)=(x,y,0)$ and the canonical projection (which is a local diffeomorphism) $\pi:S^2\to \mathbb{R} P^2$. But injectivity fails and I don't know how to correct the maps to get the embedding.
To prove the second part, if $\mathbb{R} P^1=f^{-1}(q)$ for $f:\mathbb{R} P^2\to\mathbb{R}$ smooth, $q\in \mathbb{R}$, I thought of using that $(df)_p$ vanishes if $p$ is a local maximum/minimum of $f$, and that $\mathbb{R}P^1$ is compact so $f$ achieves a maximum/minimum, so $(df)_p$ isn't surjective for all $p\in f^{-1}(q)$ so $q$ is not a regular value. Is this correct?
Thank you!
For the embedding: take the quotient of $\mathbb{S}^2$ by the antipode map to get $\mathbb{R}P^2$; the image of the embedded (in $\mathbb{S}^2$) $\mathbb{S}^1$ is a copy of $\mathbb{R}P^1$. So in particular you shouldn't use the $z\mapsto z^2$ map to go from $\mathbb{R}P^1 \to \mathbb{S}^1 \to \mathbb{S}^2$. Think about covering maps.
For the second part: your argument makes no sense because $f|_{\mathbb{R}P^1} = q$ by your construction, and is constant on $\mathbb{R}P^1$. Again, you should use the covering map construction. You can lift $f$ from $\mathbb{R}P^2$ to $\mathbb{S}^2$. But then $df$ will have to point toward the south pole for half of $\mathbb{S}^1$ and toward the north pole for the other half.