WordPress suddenly changed all links to example.com/example.com/

Check your .htaccess file for the proper values. Here’s what WP recommends; you may need to adjust for your configuration (from here; more examples that might help) https://codex.wordpress.org/htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Also, check the values on the Settings, General page that the domain name is correct.

Then check the Settings, Permalink page to go back to one of the standard values (not the custom value).

You can also check the wp_options table for the correct domain name (in two places). That requires cPanel/myPHPAdmin access, though.

Back up files before you change anything.