Let $R\subseteq S$ be a ring extension. It is true that the set of elements of $S$ that are are integral over $R$ (i.e. satisfy a monic polynomial equation over $R$) is a subring of $S$.
Can anyone provide an example showing that the set of elements of $S$ that are merely algebraic over $R$ (i.e. satisfy any polynomial equation over $R$) is not necessarily a subring of $S$?
Thanks.
EDIT: (April 2016) Thanks to Pavel Čoupek for the solution. I have incorporated this result and much more into a homework assignment. See here for the full assignment with solutions: http://www.math.miami.edu/~armstrong/762sp16/762hw3sol.pdf