Case 1: If I buy 10 lots 29 May 2014 CE 6900 at 10 and on expiry day it is trading at 50 then I am having (10 * 50 * 40) = 20000 profit. Now is it compulsory to square off my open positions to get profit or would I get profit even if I donot square off and let it expire at 50.
Case 2: Now if I short sell 10 lots 29 May 2014 CE 6900 at 50 and on expiry day it is trading at 10 then I am having profit of 20000. Again is it necessary to square off my open positions to get profit or would I get profit if it expires at 10.
Case 1: Even if you don't square off, all option contracts get cash settled, so how much ever Nifty closes above 6900, you will get that money back. so if Nifty closes at 6950, your 6900 calls will be at 50 and you will get back 10*50*50 = Rs 25000 (out of which your initial capital is 5000). The only issue with letting ITM options like these expire is that you will end up paying much higher STT. Check this link.
Case2: When you short sell at 50, you would have already received the premium of Rs 25000. On the expiry day if Nifty expires at 6910 and you don't square off, it will be settled on its own. Since Option expires at Rs 10, out of the Rs 25000 that you had already received, Rs 5000 is paid back to the option buyer (10*10*50). In case of short options, since you would have already paid STT while shorting, you don't have to worry about paying extra STT.