It looks like you have all males except the Gold ram with the eggs. The easiest way to pick females if you have good specimens (I'll get to this in a sec) is females have pink bellies and males have an extended 2nd spike on their dorsal fin (I call it their Bart Simpson hair.) There are other ways to tell the gender, such as the black spot in the middle of their bodies. In females it has the iridescent scales in the black spot, in males it's all black. Also males have little to no black on their pelvic (bottom) fins.
There are a few problems with golden rams. They are an inbred (for lack of a better term) form of the original german blue ram that has the blue bred out of them (same with electric blues but the other way around.) With this inbreeding often comes sterility especially among males. This doesn't make them any less beautiful or as fun of pets, but does make them a little less hardy than the original guys. With the inbreeding of german rams sometimes you'll have to use a combination of the above traits to get the correct gender. I've seen pink bellied males with black bottom fins way too often. These are to be avoided like the plague if you want to dabble in breeding. Often people that want to breed rams will buy males and females from different sources to ensure they aren't closely related. Good news for you is you have some good looking males which are in my experience harder to find than good females, bad news is 40 gallons isn't enough for more than 2 breeding pairs (they get super violent for peaceful fish.)
Now on to breeding. Your guys look really young. The males will get a longer dorsal fin, and darker in the face as the get older. Sorry to disappoint, but expect to lose a couple of batches of eggs. It's really hard to get a breeding pair to keep their eggs in a community aquarium. Often they will eat the eggs in an attempt to "protect them." Also juveniles aren't the greatest parents, they will leave the eggs unattended, but they learn as they go. Once they get good at being parents, and if they are still eating the eggs you can put them in their own tank when the female is ripe: belly is large and really pink. Tank only needs to be 10 gallons (fully cycled, no exceptions), a cheap sponge filter, some plants real or fake, and some flat stones. Give them some brine shrimp and let nature do the rest. You should notice during the first day which parent is doing a better job caring for the eggs, remove the other. Within a couple of days you'll be a proud parent and can remove the other adult ram. You can then get lots of store credit at your local fish shop! You can keep trying the natural way by leaving them in there but protecting the eggs is stressful on the pair and they will usually eat the eggs (I do have a friend who is very successful at letting the rams do the breeding and raising on their own in a huge community tank, but I've never had that luck.)
Hope this helps