Is it true that any group $G$ is isomorphic to a subdirect product of subdirectly irreducible groups? We know that any ring is isomorphic to a subdirect product of subdirectly irreducible rings. 
If $G$ is an additive abelian group then $G$ can easily be considered as a ring by defining multiplication "$\cdot$" on $G$ as the the map $\cdot:G\times G\to G$ defined by $a\cdot b=0_G$ for all $a,b\in G$. Denote this ring on $G$ by $R(G)$. Observe that if $S$ is a subgroup of $G$ then $S$ is an ideal of $R(G)$ and conversely for any ideal $I$ or $(R(G),+,\cdot)$, $(I,+)$ is a subgroup of $(G,+)$. In other words the ideals of $R(G)$ are precisely the subgroups of $G$. 
Observe that if $S$ is a subgroup of $G$ then $S$ is an ideal of $R(G)$ and conversely for any ideal $I$ or $(R(G),+,\cdot)$, $(I,+)$ is a subgroup of $(G,+)$. In other words the ideals of $R(G)$ are precisely the subgroups of $G$. From this observation it follows that $G$ is isomorphic to a subdirect product of commutative simple groups. But what about the case when $G$ is not abelian?
My Attempt
I was trying to generalize the idea of a ring to an algebraic structure, call it $g$-ring where the underlying additive group need not be abelian. Then I was trying to prove the following theorem,

Any $g$-ring is isomorphic to a subdirect product of subdirectly irreducible $g$-rings. 

But till now I haven't been able to prove anything close to it.
 A: See here at "Properties", the first sentence is what you're looking for. 
For a reference with a proof, you may want to check out Grätzer's Universal Algebra , or Burris and Sankappanavar's A course in universal algebra. If you want a proof I can write it up here, it's not too complicated.
Added : here's the proof. 
It's easy to see that an algebra is subdirectly irreducible if and only if it has a minimum nontrivial congruence (otherwise, if the intersection of all nontrivial congruences is trivial, then this means our algebra embeds into the product of its nontrivial quotients, and this is clearly a subdirect product). 
Now let $A$ be an algebra, and for $a\neq b\in A$, $\Psi(a,b)$ a maximal congruence not containing $(a,b)$ (it exists by Zorn's lemma), and $\Theta(a,b)$ the least congruence containing $(a,b)$. Then, finally put $R(a,b)= \Psi(a,b)\vee \Theta(a,b)$ ($\vee$ in the sense of congruences). 
Notice that any congruence strictly containing $\Psi(a,b)$ also contains $\Theta(a,b)$ : that is by maximality of $\Psi(a,b)$ and definition of $\Theta(a,b)$. It follows that any congruence strictly containing $\Psi(a,b)$ also contains $R(a,b)$. Therefore by the correspondance theorem, "$R(a,b)$" is the minimum congruence of $A/\Psi(a,b)$ : $A/\Psi(a,b)$ is subdirrectly irreducible. 
It just remains to check that $\bigcap_{a\neq b}\Psi(a,b)$ is the trivial congruence, when $A$ is not itself subdirectly irreducible .
If this is true, then $A\to \prod_{a\neq b}A/\Psi(a,b)$ will do the trick (where the indexing set is the same as above).
But well if $a\neq b$, then $(a,b)\notin \Psi(a,b)$, so $(a,b)\notin \bigcap_{c\neq d}\Psi(c,d)$, so the intersection is indeed trivial, and we are done. 
