So I have the following:
You need to set the variable to be global for that to work.
At the start of the show_form method, add this code:
global $defaults;
Or, a better solution as pointed out already is to return the variable and use $defaults = show_form().
$defaults
is a local variable within the scope of the show_form
function. You'll want to return it from the function and change your first line of code to this:
$defaults = show_form();