This worked for me:
function bbpressLoginRegisterLinksOnForumPage()
{
if ( !is_user_logged_in() )
{
echo '<div class="bbpressloginlinks" style="float:right;padding-right:20px;">';
$login_url = site_url( 'wp-login.php' );
echo "<a href='$login_url'>".' Log In '.'</a> ';
$register_url = site_url( 'wp-login.php?action=register' );
echo " <a href='$register_url' style='margin-left:20px;'>".' Register '.'</a> ';
$lost_password_url = site_url( 'wp-login.php?action=lostpassword' );
echo " <a href='$lost_password_url' style='margin-left:20px;'>".' Lost Password '.'</a> ';
echo '</div>'; // class of "bbpressloginlinks"
}
else
{
echo '<div class="bbpressloginlinks" style="float:right;padding-right:20px;">';
$logout_url = site_url( 'wp-login.php?action=logout' );
echo "<a href='$logout_url'>".' Log Out '.'</a> ';
echo '</div>'; // class of "bbpressloginlinks"
}
}