First Person Rotation Not Moving Correctly

I am making a first person game, and currently I am working on being able to move around and view. To rotate the camera, i made a quaternion with either 5 more or less degrees on x or y. But when I run it, it just mvoes up and down quickly and rapidly. How can I look around with my mouse Smoothly?

Here is my code:

using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {
	Transform tf;
	void Start () {
		tf = GetComponent<Transform>();
	}
	void Update () {
		if(Input.GetAxis("Mouse X")<0){
			Quaternion r = Quaternion.Euler(tf.rotation.x + 5,tf.rotation.y, tf.rotation.z);
			tf.rotation = r;
		}
		if(Input.GetAxis("Mouse X")>0){
			Quaternion r = Quaternion.Euler(tf.rotation.x - 5,tf.rotation.y, tf.rotation.z);
			tf.rotation = r;
		}
		if(Input.GetAxis("Mouse Y")<0){
			Quaternion r = Quaternion.Euler(tf.rotation.x,tf.rotation.y + 5, tf.rotation.z);
			tf.rotation = r;
		}
		if(Input.GetAxis("Mouse Y")>0){
			Quaternion r = Quaternion.Euler(tf.rotation.x,tf.rotation.y - 5, tf.rotation.z);
			tf.rotation = r;
		}
	}
}

In my opinion the best thing for you to do is to import the standard asset from Unity Asset Store - The Best Assets for Game Making
and check out the camera scripts in there, as they follow all the good coding practice and are a great place to start your script.

If instead you just want a simple script to copy and paste that you could expand later on, check out

 public speed float = 5.0;
 public target Transform;
  
 void Update () {
     if (Input.GetMouseButton(0)) {
         transform.LookAt(target);
         transform.RotateAround(target.position, Vector3.up, Input.GetAxis("Mouse X")*speed);
     }
 }

Taken from:
http://answers.unity3d.com/questions/418421/set-camera-orbit-rotation-on-mouse-direction-mouve.html