As other replies say, there are Trains from wherever you stay to Monaco and is quite cheap.
If you are on a budget you have some different possibilities and I'd suggest what I'd do in a budget:
- Get general entrance tickets. You still have a great view and you'll join and enjoy the Grand Prix. I believe with that ticket you can also enjoy Monaco's Castle terrace views. There is personal working and checking your tickets so you can not get in for free, but if you have a general admission ticket you can get in. There is more room than in the General Admission spot, yet I'd suggest you to be there early morning every day to get a good spot no matter where you go. Views are okay and from the castle you can track the cars almost the whole way from the pool section to the end of the straight line and some more.
To me, the Castle View is quite a good view giving the case that we are speaking about a Urban City racetrack so you know you won't see as much as in a regular permanent racetrack no matter where you do place yourself.
- Try to contact a Track Marshal from the Grand Prix. I did that 3 years ago and bought my tickets through him. I got 3 days tickets for the Pool section grandstand for 300€ cheaper than usual prices. I payed 500€ instead of 800€. (yes, I know it is still a lot of money). They do have some % discount and so you can just ask some of them to help you purchase cheaper tickets.
Those are my main options being on a budget. Might be others but those are the ones I know. Of course you can also go and enjoy the atmosphere of the Grand Prix not having any tickets nor view of the races, but can be quite frustrating.