First, make sure that it's legitimately for rent. Some scammers will find properties for sale, then construct a fake "for rent" listing. They'll use the same photos that are in the legitimate for sale listing. Then they'll list the property at a very attractive price. They'll collect a deposit plus first month's (and maybe last month's) rent...and then disappear.
If it really is available for both rent and for sale--and some are--try to find out whether the owner plans to accept whichever comes first. For example, if you rent, does the owner plan on withdrawing the for sale listing?
A lease carries on despite the sale of a property (unless the lease contains some specific language saying that the lease is terminated upon sale). So usually a tenant is OK if he/she is renting and the property is then sold. The lease runs until its expiration, and becomes the responsibility of the new owner. However, when the initial lease expires, the new owner can decide not to offer you a new lease, or to offer you one well above the price you were paying.
Hopefully, you're using a Realtor. Run these questions past him/her and find out the specifics for the property you're interested in.
Hope that helps.