Show a list of pages but hide the current page from the list
To me it looks like the entries in the section with the handle pages have their own URLs. This means that if you visit a URL that belongs to an entry in that section Craft will automatically make that entry available in the template as the entry variable. That being said your solution is in this case:

{% set currentPageId = entry.id %}
{% set pages = craft.entries.section('pages').id('not ' ~ currentPageId).all() %}
&lt;nav id="navigation"&gt;
    &lt;ul&gt;
        {% for page in pages %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
&lt;/nav&gt;


Or as an alternative:

{% set pages = craft.entries.section('pages').all() %}
&lt;nav id="navigation"&gt;
    &lt;ul&gt;
        {% for page in pages if page.id != entry.id %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
&lt;/nav&gt;


Here is a read about how Twig handles variable scope if you ask yourself why the entry variable is available in the included template:
https://nystudio107.com/blog/twig-processing-order-and-scope

Also, here is a link to Twig's docs on conditional for loops: https://twig.symfony.com/doc/2.x/tags/for.html#adding-a-condition