I'm sorry, but it is provably impossible to make bisection (or any scheme like it) always find all solutions of an arbitrarily complicated problem. Sorry, but that is true.
However, what you might do is to evaluate your function at a regular list of points on that interval. If the function changes sign between a consecutive pair of those points, then you would use your bisection scheme, returning a root on that sub-interval. Keep a list of all the roots you have found, and you are done. That will not insure that you find all roots, but if the list of points is fine enough, then it will get most of them.
Will I write the code for you to do this? Of course not. This is your homework, not mine.