From my conversation in the comments with you You're going to need to go to paste your Jquery inside web/js and call it something like, lets say function.js. Save this inside that folder, next go to Vendor/Theme and if there's a Magento_Theme folder there go inside layout and click on default_head_blocks.xml. If not, you will need to create this file structure. (vendor/theme/magento_theme/layout/default_head_blocks.xml). Inside here you're going to want to insert <script src="js/function.js"/>
line just after
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
if you're making this file you then want to write
</head>
</page>
after it. Save, flush cache and reload the page and the file should be referenced in your head. If it is but it isn't working, you can also use this to insert a Jquery cdn. I hope i've helped