It's always more enjoyable to ride with others than to ride alone. However, riding with someone or riding in a group requires adherence to certain rules. It also requires some skills that  take a little practice. These rules and skills  are put in place to protect the rider and the group they are riding in.

 Let's have a look at some group riding etiquette

1. Be Predictable: Smooth predictable riding will  keep your group safe, it involves every aspect of your riding such as changing positions and following traffic rules. Maintain group integrity. Stay with the group , hold your line and avoid scattering. Start together and stop together.

2.Do not Overlap Wheels: In fact, don't even stare at the wheel in front of you. If you start fixating, you will crash into it eventually. Avoid overlapping wheels, all it takes is the front rider to shift a few inches sideways and you will go down along with the whole line behind you.....a velodramatic event. Your handlebars should be parallel with your paceline partner, if they are not you are half wheeling

If you are falling back because you can’t keep up with your partner, and he is not going too fast, that means you need to go to the back. If you are falling back because the guy or gal is inexperienced or a hothead and trying to push the pace at an inappropriate level of effort, just let him ride forward and burn out in the front for a good long damn while.
— Group Riding Etiquette.

 

3.Aim to be a Steady Rider: This includes holding your line and your speed. Don't make sudden movements. Don't slam on the brakes, feather them lightly if you must. Keep steady pressure on the pedals. 

4.Announce Hazards: If you are leading a ride you are responsible for the group behind you. Make sure you point out hazards such as potholes, sand, rocks or gravel in the road. Be vocal and be loud so everyone can hear you and use hand signals to convey your message. The other riders in the pack should relay and hazards to the others in the back. 

When going over bridges or narrow roads, call out “single file.” Each traffic-side rider should fall back behind the rider next to her if the group is in a double pace line. Resume double file riding when it is safe to do so, as indicated by the front file only.
— Group Riding Etiquette

5. Don't leave Riders Behind: You started as a group so finish as a group.  If some get left behind stop and regroup. A no drop policy will ensure better numbers in a group and encourage other weaker riders to stay motivated on their cycling journey and give them a chance to improve their performance.

6.Change Positions Correctly: If you are pulling out of the front, keep pedaling maintaining steady pressure. After pulling off soft pedal and let the group through. As the last few riders are passing, increase the pressure on your pedals and take your position at the rear. Timing is key, if you wait too long you will create a gap and have to sprint to get back.

7. Climbs: If you are going to come out of the saddle make sure to add an extra gear. Keep it smooth and steady, this will help your bike from moving backwards towards the rider  behind you. Use hand signals if you are going to stand up, let the rider behind you know your intent.

8.Downhill Descents: The lead rider has to overcome much more wind resistance as the speed increases. This means as the lead rider you must continue to pedal. The group behind you will accelerate faster as drafting becomes more effective at higher speeds. If you are following, allow more space between riders. You can also sit up in an attempt to slow down a little if you are getting close to the rider in front of you. Keep pedaling, if you coast downhill everyone behind you will have to brake.

9. Relax: The quickest and cheapest way to increase power output and safety on the bicycle is to relax your face and jaw.This sends a message to your upper body to relax. It relieves tension in your upper body and allows your center of gravity to drop slightly. This will make you respond to hazards and corners better.

*Always stop and help with repairs, look out for your fellow riders.

A few words on cornering courtesy of -Safety and Etiquette Of Group Riding document.

Cornering

Keep your eyes ahead of your line of attack. Looking down at your wheel or the curb will shift your center of gravity and make the speed seem more intense. Don’t think about what is going on underneath you, but ahead of you.

Relax. Let your hips and legs do the steering, not arms and shoulders. When properly relaxed, the g-forces of a corner will make it feel as if your handlebars and seat are compressing into your body.

Don’t push away from the bars or straighten your elbows. If pressure is removed from the front wheel, it will slide out from under you.

As always, relaxing your face and neck muscles will allow the other parts of the body to align properly before entering the corner.

Pedal all the way through if you can. This keeps your legs from tensing, and keeps your speed up so no one wrecks into you. Momentum, momentum, momentum. Let this be your mantra.

Counter-steering is absolutely mandatory for cornering at speed.  It merits a long discussion and physical demonstration, but you have to learn it to even keep up on a fast training ride.  So learn it!

Braking is absolutely forbidden, but you will find yourself doing it a lot in slower races or on difficult courses. If you must use them, remember that braking effects are accentuated in corners. Use even more finesse than you would in a pace line, and always brake before the corner, not in it.

Keep a firm grip on the drop portion of the bars, where your center of gravity is lowest, but not too tight. Bend your elbows so they can absorb shock.

Posted below is a 20 minute video, whether you are a beginner or just need a brush up on group cycling rules this video does a pretty good job of explaining things.