If you use the optical viewfinder in a DSLR (Nikon D5100) camera, are you supposed to turn off the LCD screen (flip it in closed position)?
There's no reason you have to turn it off, but it can be less distracting and will save batteries. The discontinued D60 model used to turn off the rear panel when you held the camera to your eye, but the newer models don't have that.
Higher end models, like the D7100, have a separate small LCD panel on the top of the camera, which is useful for adjusting settings without needing the large back panel. Entry-level models usually forgo this to save space, cost, and complexity, and in exchange, the rear LCD is usually more important for finding out the status of the camera's various settings, or even for setting them. (The D5100 doesn't have a dedicated button for ISO, for example, or a switch for focus modes.)
A lot of information is available around the edges of the optical viewfinder too, but since the space is constrained the data there tends to be very terse.
Once you start using a DSLR in a way that pushes its limits then you are "supposed" to use it in the manner that best suits and/or pleases you, and or that best enables you to achieve the maximum from the camera as determined solely by you, and/or that makes you maximally happy.
Some other people may have strong preferences as to how a camera should be used or set and will advise you if you ask them, or in enough cases, even if you don't.
Note how much you like or value what they achieve (noting that in some cases you will not initially have enough experience to know whether in time you will come to appreciate and value advice which initially seems pointless or wrong.)
Listen and act on their input (or not) accordingly.
ie, unlike dealing with people :-), you are master and decision maker of how the camera can and should be used and can use it in whatever way you wish. Be guided by those further along the road, but do not be dictated to. [Only follow this advice if you want to :-) ].
Screen on: more power drain, more information, more visible to others, may cause exposure issues in some dark situations, ...
Screen off" longer battery, turned in screen is more protected, MAY make some cameras more responsive in some cases, camera may not appear visibly on to others ...
I would usually uses screen on by default with cameras that I use as it usually maximises overall performance BUT will turn it off when the situation benefits from it.
I don't know Nikon's bodies very well, but there is no reason you should have to turn it off. It is worth noting that unless your camera body has a semi-transparent mirror, you will not be able to see the image through the viewfinder and the LCD at the same time. The image will either go to the sensor and then the LCD or a mirror will flip down and the image will be directed to the viewfinder.
You could still use it to display other information about what you are shooting or to have a quick review of the image though if it suits the way you want to work with it. You certainly don't have to have it on, but there shouldn't be any reason you can't use it however it will allow itself to be used while the mirror is down.