How to add and remove a page

Why do you need to create a page?

Its possible that before plugin deactivation, the page no longer exists, so your deletion function will need to check for if it exists

But yes you will need to store the ID somewhere.
Best option is to just update_option(‘icreatedapage’, $pageid);

if ($pageid == 0) {
    echo "Something went wrong. Could not successfully add a new page.";
} else {
    update_option('somename_relatedtoyour_plugin_name', $pageid);
}

Tho what do you do if you page fails to create?
You will need to considering including instructions on how to manually create it, or let the user do it themselves…