How/where do I add $('#fullpage').fullpage() code? I want use the fullpage library. In my theme.libraries.yml file, I added theses lines. 

fullPage:
  header: true
  js:
    js/fullPage.js/jquery.fullPage.js: {}
  dependencies:
    - core/jquery


jquery.js and jquery.fullPage.js are now present in the &lt;head&gt; tag, 
but to run fullpage.js, I must execute [this additional script2.

$(document).ready(function() {
    $('#fullpage').fullpage();
});


How and where do I add this little script?
You need to create a javascript file in your theme and attach it to pages as shown in the documentation.
https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme

Make sure you theme library has a dependency on fullPage.