cpt getting over on Aug 8th and H1b starting Oct 1st

My CPT is getting over in Aug 8th and my H1b starting from Oct. 1st. What should I do Can I stay in a valid status legally or I will become illegal fro 2 months till my H1b starts? Can I work during those 2 months from Aug to Oct? Do i need to take admission in any college for maintaining the status? Do I need to maintain any status during that 2 months? Do I need to notify school from where I have CPT that I have got my H1b? Or I dont need to notify college?

Check with your university if your case falls under the CAP-GAP period. If yes, then you can request for a cap-gap I-20 and you will be good.