please use die
to stop code and return response.
function check_user() {
$user_name = $this->input->post('user_name');
$res_user = $this->user_model->is_unique_user($user_name);
die($res_user);
}
And ajax sucess function change response.data
to response
success: function(response){
if(response == 'exist'){
$("#user_name").after('<p class="help-block">Username alredy exist</p>');
}else{
$("#user_name").after('<p class="help-block">Username available</p>');
}