It's generally not a good idea to keep a male and female guinea pig together if you're not prepared to deal with breeding. Female guinea pigs reach sexual maturity at around 2-3 months old, and a male guinea pig can impregnate a female at any time after reaching maturity. Guinea pigs breed quite prolifically, and you could end up with a large number of unwanted babies if you keep a male and female together.
If you'd like to keep both male and female guinea pigs, it's best to keep them in separate cages and introduce them to each other for supervised playtime on a regular basis. This will allow them to interact and socialize with each other without the risk of unplanned breeding.