There are built-in button widgets for closing the current page (going back) as well as signing out. They are called, aptly, the "Close page button" and the "Sign out button".
You should use these and then style if necessary using CSS. Buttons have an option to add icons or images to them, and CSS will let you make them look any way you want.