How do you get the nid from an entity id?
It's important to understand that if all you have is the id of any entity, then there is no way to load a specific entity with that id. Since entity_id's are not unique across entity-types, it is necessary to know both the entity type, and the entity id.

See Developers need an $entity->entity_type property for a discussion on changing this for D7, as well as info about how this will be likely be handled in D8.

On the other hand, as pointed out in a different answer, if you already know that the entity id is a node id, then you can call an entity specific load function like node_load($nid). Since most entities will have such a load function to support named arguments, such a "shortcut" function will be almost universally available.

Examples: node_load(), taxonomy_term_load(), commerce_product_load().