If you have rented or borrowed battlefield 3, you can activate a temporary online pass from this site: onlinepass.battlefield.com. once there, make sure you log in with the origin account that you want to assign the pass to.
After making the request, your account will automatically be granted access to a 48 hour online pass trial for the platform you selected, and you will receive a notification email (make sure you check your spam folders if you can't find this email.)
Once the trial has expired, you will also receive an email letting you know when the access period is over. please note, you can only get this free trial pass once, for any platform, all future attempts to activate a pass will be rejected.
After this point, if you want to continue to play bf3 multiplayer you'll need to purchase an online pass. You do this at the Origin store, the procedure for this depends on what platform you are on.
Remember to accept the solution if it's correct and press the XP button if somebody helped.
Cheers
-Carbonic