Doubt regarding sum of a subring and an ideal need not be subring. We know that sum of two subrings need not be a subring, but then why is the following so:

Let $A$ be a subring of a ring $R$ and $I$ an ideal of $R$ . Then  $A+I=\{a+i\mid a\in A,i\in I\}$ is a subring of $R$.

This was written in statement for second homomorphism theorem, but I can't understand why is $A+I$ a subring.  
 A: Let $R$ denote a not-necessarily commutative ring. Assume that $A \subseteq R$ is a subring and that $I \subseteq R$ is a two-sided ideal.
Let us show that $A+I$ is closed under products, since closure under addition is trivial, and so too is closure under unary negation (by which I mean the function $x \in R \mapsto -x \in R$). So suppose $x,y \in A+I$. Then $x=a+i$ and $y=a'+i'$ for appropriate choices of $a,a' \in A$ and $i,i' \in I$. So
$$xy = (a+i)(a'+i') = \underbrace{aa'}_{\in A}+\underbrace{ia'+ai'+ii'}_{\in I} \in A+I$$
So $A+I$ is closed under products.
We can write the above argument in more compact notation as follows:
$$(A+I)(A+I) = \underbrace{AA}_{\subseteq A}+\underbrace{IA+AI+II}_{\subseteq I} \subseteq A+I$$
Remark. If $R$ has a unity element $1,$ and if $1 \in A,$ then since $1+0 \in A+I$, hence $1 \in A+I$.
A: The usual method should work: just show closure under $0,1,+,-,\cdot$. It's hard to give any more advice than that without you showing why you're having problems: maybe you're forgetting the (usual) defining property of ideals?
For variety, another approach is to use the fact that if $f : R \to S$ is a ring homomorphism and $T \subseteq S$ is a subring, then $f^{-1}(T)$ is a subring of $R$.
