Using the "Facebook Chat" program, it's possible for other users on your Facebook contact list to see if you're online, because your name appears in their list of online friends. It's possible to remove yourself from this list if you don't want people to see you online, although doing so blocks you from communicating with other Facebook users via chat.
Log in to Facebook using your e-mail address and password. After you log in, you'll be "visible" to other users as being currently online, until you set yourself as being invisible.
Click the "Chat" button at the bottom-right corner of the screen. Click "Options" to show options for the "Facebook Chat" window.
Click the "Go Offline" button to prevent other users from seeing you online. Understand that doing so prohibits you from communicating with others via chat for the duration of your time on the site.