Inara is a highly regarded, registered Companion, and the most respectable person aboard Serenity. No one seems to know what such a high-priced working girl is doing on the very low class Serenity, least of all Malcolm Reynolds.
She’s elegant, educated, and beautiful. She maintains her own space - a shuttle on the ship - and chooses her clients according to her own standards, usually from the upper class.
She does not count the crew among her clients.
Prostitution (or at least licensed prostitution) is legal on almost all planets thanks to the influence of The Guild. A Companion is essentially of the highest social standing - certainly higher than a ship full of petty crooks. Simon Tam might have been able to contract with her before he spent his fortune...but then again, he might have been disappointed.
Inara was born, raised, trained, and practiced her craft on on her home planet of Sihnon, the jewel of the Core Worlds. She was a shoo-in for the rank of High Priestess of The Guild when she left Sihnon over a year ago. She has adapted quite well to the wild border worlds... she even owns a pistol. And while Inara may be traversing the fringes of the 'verse with Serenity, she is still a member of The Guild, with access to its perks. As she notes to a client she "fired" in Shindig:
There exists a romantic tension between Inara and Malcolm Reynolds through all the episodes of Firefly, but comes to a head in Heart Of Gold. Malcolm frequently refers to Inara as a 'whore'. Partly it's to show his disapproval of her profession, but he also seems to enjoy baiting her. In Shindig he demonstrates a great deal of respect for Inara:
In the DVD commentary a hidden storyline concerning Inara is alluded to. This storyline was not developed past the 'hints' stage. The commentaries mention clues: among those is the conversation she has with Simon in the episode "Out of Gas", specifically the line "I don't want to die at all".
Another hint is also shown in the episode Heart Of Gold, at the point when Nandi tells Inara that she doesn't "look a day older." Finally, another clue is given in Bushwhacked, when Inara tells Simon that "we're all running away from something." Note how this contrasts with her defensive exclamation in Out Of Gas: "I'm not running away from anything."
This unresolved plot may have something to do with the reason Inara left such a prominent position on Sihnon and chose to travel the rim.
One theory states that Inara is using some kind of drug to maintain her youthful appearance, and that she is older than she looks.