Proving $\mathbb{Q}[\sqrt{2}] = \{f(\sqrt{2}): f(x) \in \mathbb{Q}[x]\} = \{x+y\sqrt{2}:x,y\in\mathbb{Q}\}$ I need to prove that:
$$\mathbb{Q}[\sqrt{2}] = \{f(\sqrt{2}): f(x) \in \mathbb{Q}[x]\} = \{x+y\sqrt{2}:x,y\in\mathbb{Q}\}$$
Well, $ \{f(\sqrt{2}): f(x) \in \mathbb{Q}[x]\} $ is the set of $a_nx^n+\cdots +a_0$ when we take $x\in \mathbb{Q}$, so of course 
$$\{x+y\sqrt{2}:x,y\in\mathbb{Q}\} \subset \{f(\sqrt{2}): f(x) \in \mathbb{Q}[x]\}$$
but how to prove 
$$\{f(\sqrt{2}): f(x) \in \mathbb{Q}[x]\}\subset \{x+y\sqrt{2}:x,y\in\mathbb{Q}\}$$?
Can I just assume that I can arrange all the coefficients of $\sqrt{2}$ into one term in parenthesis and the same for the rationals coefficients?
Also I´m asked to prove that 
$$J = \{f(x)\in \mathbb{Q}[x]:f(\sqrt{2})=0\}$$
is a maximal ideal of $\mathbb{Q}[x]$
any ideas?
 A: Hint: Let $f(x) \in \mathbb{Q}[x]$. You can write $f(x)=q(x)(x^2-2)+ax+b$ for some $a,b \in \mathbb{Q}$. $f(\sqrt{2})=a\sqrt{2}+b$. (Thats the Euclidean algorithm,since $\mathbb{Q}$ is a field).
You can fill in some missing details.
As for the second part, it can be shown from first principles. You can first prove that $J=(x^2-2)$. The inclusion $(x^2-2) \subseteq J$ is more or less obvious. The other one can be done just by looking at the first part (if $f(x) \in J$, show that $a=b=0$). So once you get $J=(x^2-2)$, you can show that it is maximal ($x^2-2$ is irreducible). 
A: The key fact is that $\sqrt 2$ is a root of the polynomial $X^2-2$. 
For the first part, you can indeed "just rearrange the coefficients". Let $$f(X) = a_0+a_1X+\cdots +a_nX^n$$ be any polynomial in $\mathbb Q[X]$. Then $$f(\sqrt 2) =(a_0 + 2a_2+4a_4+\cdots)+\sqrt 2(a_1+2a_3+\cdots).$$
For the second part, can you use the division algorithm to show that if $f(X)\in J$, then $(X^2-2)\mid f(X)$? Can you then show that $J$ is the ideal generated by $X^2-2$? What is $\mathbb Q[X]/J?$
