Suppose that $R = \Bbb{R}[X]$ with the usual addition and multiplication of polynomials as ring operators. Further suppose that an ideal $I \subset$ $ \mathbb{R}[X]$ contains the polynomials $X^2 + 1$ and $X^5+X+1$. Show that $I=\Bbb{R}[X]$.
answer: We already know that $I \subset \mathbb{R}[X]$; the equality $ I= \mathbb{R}[X]$ can be proved by double inclusion. The polynomials $X^2+1$,$X^5+X+1 \in I$ and since $I$ is an ideal:
$$r \in \mathbb{R}[X] \Rightarrow r(X^2+1) \in I $$ $$s \in \mathbb{R}[X] \Rightarrow s(X^5+X+1) \in I $$
According to the extended Euclidean algorithm, one can find polynomials $r$ and $s$ such that :
$$r\cdot(X^2+1) + s\cdot (X^5+X+1) = \text{gcd}(X^2+1,X^5+X+1)=1 $$
that is as well an element of $I$ because of the closed property of an ideal ring.
$\forall f(x)\in \mathbb{R}[X]$ we have that $f(x) \cdot 1 \in I$ it follows that : $f(x) \in I$. So we can conclude that $\mathbb{R}[X] \subset I$.
Like I said, your proof should be okay, barring some stubbornness from a grader about how obvious it is that $\gcd(X^2+1,X^5+X+1)=1$. Here is another approach that amounts to the same thing:
Since $I$ is an ideal containing $X^2+1$ and $X^5+X+1$, we have
$$1=(X^5+X+1)-(X^3+X)(X^2+1)\in I$$
which as you've noted implies $I=\Bbb{R}[X]$.