You need to install it on both, but you only need to purchase Mountain Lion one time.
Are you looking to use AirPlay to share between your iMac and MacBook Pro? Hard to tell from your question but if this is what you are looking to do I don;t believe it is going to work.
AirPlay is for streaming to an Apple TV from your OSX or IOS devices not for going from device to device (at least that is the way I read it).
Also you need to check out if your hardwre supports AirPlay, only newer Macs will run it.
Message was edited by: Frank Caggiano - OK it will also work with newer Airport Express.