I am trying to prove the following statement: Let $R$ be a real closed field (such as the real numbers). Let $M\subseteq R^n$ be a semi-algebraic set, i.e. a set which is defined by a Boolean combination of finitely many polynomial inequalities. Suppose that $M$ is unbounded, closed and star-shaped, i.e. there exists $z\in M$ such that for any $x \in M$ the segment $[z,x]$ is contained in $M$. Then $M$ contains a ray starting at $z$.
It is possible that the proof for general $R$ works just like a proof for $\mathbb{R}$. I also think that the fact that $M$ is semi-algebraic does not have to be used directly. Instead one can use that semi-algebraic sets are semi-algebraically compact if and only if they are closed and bounded. A set $A$ is semi-algebraically compact if every definable path $\gamma: [0,1) \to A$ has a limit point $\lim_{t \to 1} \gamma(t)$ in $A$.
My idea: Assume that $M$ contains no ray starting at $z$. Assume further that $M$ is star-shaped centred at $z$ and closed. Deduce that $M$ is compact, which implies that $M$ is bounded. This would prove the contraposition. But I don't really have an idea as to how to show compactness. We would need to show that every definable path in $M$ has a limit in $M$.
Another idea I had was to use that $R^n$ is semi-algebraically homeomorphic, i.e. homeomorphic via a semi-algebraic mapping $p$, to $S^n\setminus\{N\}$, where $N$ is the north pole of the sphere $S^n$. A set $M$ is unbounded in $R^n$ if and only if $N$ lies in the closure of $p^{-1}(M)$. Hence we might be able to work in $S^n$ instead of $R^n$.
I have an answer now. The problem can indeed be solved in $\mathbb{R}$, as for any real closed field the result can be transferred (Tarski's transfer principle) when it is stated about semi-algebraic sets.
We prove the statement directly. Without loss of generality $z=0$. Take an unbounded sequence $a_k$ in $M$. This gives us a sequence $b_k$ in $S^{n-1}$, the $(n-1)$-dimensional sphere centred at $0$, by taking the intersection point $b_k = \frac{a_k}{\|a_k\|}$ of the segment $[0,a_k]$ with $S^{n-1}$. Since the sphere is compact, $b_k$ must have a convergent subsequence $b_{k_\ell}$ with limit point $b \in S^{n-1}$. It remains to show that for each $t\in \mathbb{R}$, $t\geq 0$, the point $tb$ lies in $M$. Fix such $t$. Then the sequence $c_\ell = tb_{k_\ell} = t\frac{a_{k_\ell}}{\|a_{k_\ell}\|}$. The sequence $a_{k_\ell}$ is unbounded, whence $\frac{t}{\|a_{k_\ell}\|}$ eventually becomes less than $1$. Hence, for sufficiently large $\ell$, $$c_\ell \in [0,a_{k_\ell}]\subseteq M.$$ Since $M$ is closed, the limit point of $c_\ell$, which is $tb$, lies in $M$, as required.