The estate onclick returns the code of the click event handler on the current element.
The correct use would be:
var x = document.getElementById("title");
x.onclick = function() {
    this.innerHTML = 'O usuário clicou, o titulo foi alterado!';
}
<h1 id="title">Somente alguns testes em JS</h1>
 
 
Note that you do not need to check up on if it was clicked. It can also be done like this:
var x = document.getElementById("title");
function minha_funcao() {
    this.innerHTML = 'O usuário clicou, o titulo foi alterado!';
}
x.onclick = minha_funcao;
<h1 id="title">Somente alguns testes em JS</h1>
 
 
Using object:
var x = document.getElementById("title");
var objeto= {
    clicks: 0,
    check: function() {
      if (this.clicks === 0) {
        return false;
      } else {
        return true;
      }
    },
    click: function() {
      x.innerHTML = 'O usuário clicou, o titulo foi alterado!';
      objeto.clicks++;
      console.log(objeto.clicks);
    }
};
x.onclick = objeto.click;
<h1 id="title">Somente alguns testes em JS</h1>
 
 
You can also use the method addEventListener to add an event to the element.
var x = document.getElementById("title");
var objeto = {
  clicks: 0,
  check: function() {
    console.log(objeto.clicks);
    if (objeto.clicks === 1) {
      x.addEventListener('click', objeto.click_B);
    }
  },
  click_A: function() {
    objeto.clicks++;
    x.innerHTML = 'O usuário clicou, o titulo foi alterado! Clicou ' + objeto.clicks + ' vez';
    objeto.check();
  },
  click_B: function() {
    x.innerHTML = 'O usuário clicou, o titulo foi alterado novamente! Clicou ' + objeto.clicks + ' vezes';
  },
};
x.addEventListener('click', objeto.click_A);
<h1 id="title">Somente alguns testes em JS</h1>
 
 
Observing:
The way the AP described in your question, it works as long as you do:
var x = document.getElementById("title");
x.onclick = {
  click: function() {
    console.log('Ele clicou no H1');
  }
}.click;
<h1 id="title">Somente alguns testes em JS</h1>
 
 
But an extremely important point to note, is that if it has another method in this object, it cannot be executed. See the following example:
var x = document.getElementById("title");
x.onclick = {
  funcao_a: function() {
    console.log('Função A');
  },
  click: function() {
    console.log('Click');
    x.onclick.funcao_a();
  }
}.click;
<h1 id="title">Somente alguns testes em JS</h1>
 
 
References
							
							
						 
Where did you get this code ?
– NoobSaibot
I wrote that.
– Matheus