Homomorphism, Ideal and Subring 
Let A be a commutative ring. Suppose $2x=0$ for every $x\in A$. Prove that $(x+y)^2=x^2+y^2$ for all $x,y \in A$. Conclude that the function $h(x)=x^2$ is a homomorphism from $A$ to $A$. If $J=\{x\in A: x^2=0\}$ and $B=\{x^2:x\in A\}$, explain why $J$ is an ideal of $A$, $B$ is a subring of $A$ and $A/J \cong B$.

Ok so to start: $(x+y)^2=x^2+xy+xy+y^2=x^2+y^2+2xy$ and since $2x=0$, $x^2+y^2+0\cdot y=x^2+y^2$.
I get a little lost on proving the homomorphism,


*

*$h(a)h(b)=a^2b^2$ and $h(ab)=(ab)^2=abab$ and since A is commutative: $abab=aabb=a^2b^2$ so $h(a)h(b)=h(ab)$.

*$h(a)+h(b)=a^2+b^2$ and $h(a+b)=(a+b)^2=a^2+ab+ab+b^2=a^2+b^2+2ab$. This is where I think I can use the given $2x=0$ and apply it to $a$ so $2ab=0\cdot b =0$ so $h(a+b)=a^2+b^2$.
Thus $h$ is a homomorphism.
I have a question when we get to $J$. Whats the difference between the way $J$ and $B$ are defined? Proving $J$ is an ideal means that $ax=xa \in J$ for any $a\in J$ and $x\in A$. I'm a tad stuck here as I feel like I don't quite know how to show this? I'm sure proving the subring will follow easier once I understand the definition part. And once I have $J$ I can use the FHT to say they're isomorphic.
 A: The real meat of this question is in the second part, so I'll focus on that.
The difference between $J$ and $B$ is the following: $J$ consists of each element that squares to become $0$, while $B$ consists of all elements that are squares. Less concretely, whether an element is in $J$ depends on what happens when you square it, while whether an element is in $B$ depends on whether it is has a square root. They are, as it were, on "different ends" of the squaring map (this will be relevant at the end).
As for whether $J$ is an ideal, we have to prove several things:


*

*For $x, y\in J$, we have $x+y\in J$. This is because $(x+y)^2 = x^2 + y^2 = 0+0 = 0$, so $x+y$ fulfills the defining property of elements in $J$

*For $x\in J$ and $a\in A$, we have $ax\in J$. This is because $(ax)^2 = a^2x^2 = a^2\cdot 0 = 0$ so $ax$ fulfills the defining property of elements in $J$
Or you could go the easy route and see that $J = \ker h$, and kernels are always ideals.
Next, showing that $B$ is a subring of $A$. Again there are some things that need to be checked:


*

*$0,1\in B$. This is because $0^2 = 0$ and $1^2 = 1$, which means that $0$ and $1$ fulfill the defining properties of elements in $B$

*For $a, b\in B$, we have $a+b\in B$ and $ab\in B$. If $a_0^2 = a$ and $b_0^2 = b$, then $(a_0+b_0)^2 = a+b$ and $(a_0b_0)^2 = ab$, so $a+b$ and $ab$ have square roots and are therefore elements of $B$.

*If $a\in B$ then $-a\in B$. This might seem tricky until you realize that the defining property of $A$, i.e. that $2x = 0$ for all $x\in A$ means that $a = -a$.
(I might have accidentally forgotten a check in the two lists above. If that's the case, leave a comment, and I'll fix.)
Finally, it's time to tackle the question of whether $A/J$ is isomorphic to $B$. Here the first isomorphism theorem comes to the rescue, saying that $A/\ker h \cong \operatorname{im} h$. As previously mentioned, $J = \ker h$, and we see from the definition of $B$ that it is exactly $\operatorname{im} h$. Thus we are done.
