Insert Content Before div#main from the functions.php File

The markup surrounding the content is not specified by WordPress, so there is no hook for that.

But you can declare your own hook there. In your template file, write …

<?php
do_action( 'before_content_container' );
?>
<div class="main">
    <?php
    the_content();
    ?>
</div>
<?php
do_action( 'after_content_container' );
?>

… and then you can register a callback for that action in your functions.php.