I hear black people using the N. word when referring to other people quite often on the internet and on YouTube and it seems to be legal or at least there are no complaints. Would it be legal if a caucasion used this term? If not there would appear to be some injustice and surely the white person would be entitled to claim reverse discrimination. Can you shed some clarity on this issue?
It's perfectly legal for anyone at all to say and write the word, "nigger". Its use by a white person related to an action against a black person may be interpreted as evidence of a hate crime or unlawful discrimination. Using it publicly to describe a black person might have a number of negative consequences, but none of them from the law.
Use of the word "nigger" is not itself a criminal matter in the US. However, the Civil Rights Act, as it has been interpreted, prohibits a "hostile environment" in education, employment, housing and some other contexts. This is a civil matter--that is, cause for a lawsuit, usually against the institution at which the hostile environment occurred.
Your question seems to be about whether the law regards use of "nigger" by black people differently than its use by white people. The short answer is no. Nothing in the Civil Rights Act or other anti-discrimination legislation says that different conduct is permissible depending on your race. In fact, any such distinction would probably violate the Equal Protection Clause of the 14th amendment.
HOWEVER, let's say a black person claims they endured a hostile environment because someone used the word "nigger." The court or equal opportunity employment commission would probably consider the how the word was used. So they would probably regard, for example, affectionate use of "nigga," as is common among black people, differently than derisive or hostile use of the word. Intent, frequency, context, and personal relationships would all figure in to that. But there can be no clear lines based solely on the race of the speaker.
For example check out this case, in which a black manager was harshly penalized for calling one of his employees "nigger." He defended himself by pointing out the more benign use of the term in black English, but the court wasn't convinced. What mattered here was that he was using the word in a way that was critical and drew on racial prejudice. His being black was no defense.