Implement algebraic and graphical methods to find an inverse function of an existing function, restricting domains if necessary.