No, the Inspect Element tool is not illegal; it's designed for web developers. Viewing source code for a website isn't illegal; it only becomes an issue if you use the information gathered for nefarious purposes, such as attempting exploits, etc.