I've heard that two male bettas have been kept in a big (like 10g) tank, but I still wouldn't try it. It would be an experiment that is not worth having a dead fishie over.
In general you can tell if it is a...
Male betta: Long, pretty fins
Female betta: Short fins. Some of them have rather bright fins, but in my experience, most females have either grey, black, dark red, or whitish (like, pearl or opal-like) fins.