Can’t get title of latest post

You’re getting there! Couple of issues – you need to actually grab the latest posts before you can work on them. And post_title is not a property of the ID, but the object itself:

if ( $posts = get_posts( 'numberposts=1' ) ) {
    $title = $posts[0]->post_title;
    // carry on sir
}

Note: Ensure you have define( 'WP_DEBUG', true ) in your wp-config.php when developing on WordPress – it will help immensely with debugging!