It is important to be careful in differentiating truth, implication, and proof .. if you find your professor's statements hard to believe (or at least 'weird' enough to spurn you to post a question here), I suspect either your professor was conflating a few things here, or you are misinterpreting what they said.
Implication
In mathematics and logic we often use a certain notion of implication, expressed as as 'if ... then ...' statement, where all we mean to say is that it is not the case that the 'if' part is true and the 'then' part is false. I assume your professor was showing you the truth-table for this, and the truth-table shows that that kind of implication is automatically true when the 'if' part is false. Indeed, no matter what the 'then' part says, and no whether that 'then' part is true or false, the whole implication is true. And I suspect that that is all that your professor was trying to say.
Proof
A proof is different from an implication. In a proof we say: "This statement is true. Therefore, this other statement is true.". So this is not a statement. but an argument, where you infer one statement (the conclusion) from one or more others (the premises or assumptions). And the argument is an actual proof if the argument is valid, meaning that every step follows agreed upon inference principles such as Modus Ponens or Simplification.
So, given that your professor seemed to merely talk about implications and their truth-conditions, I find your professor's use of the word 'prove' a little out of place.
Still, something similar is going on when it comes to proofs. Again, a proof is valid if the conclusion logically follows from the premises. Another way to think about this is: An argument is valid if and only if in all logically possible worlds where the premises are true, the conclusion is true as well.
So, consider now a statement like 'bananas are pink and bananas are not pink'. This kind of statement is called a contradiction, because it cannot be true: there is no logically possible world where this statement is true. But if there is no world in which it is true, then it becomes vacuously true that in all (zero!) worlds where it is true, something else is true as well. That is, when it comes to proofs, we can derive ('prove') anything from a contradiction.
Proof and Truth
Now, notice how I put 'proof' in parentheses ... because this does seem weird. "Wait! I can prove that the Statue of Liberty is underwater from a contradiction?!? How can I prove something that isn't so?". Well, remember that all you do with a proof is to show that if you assume something to be true, then something else is true as well. But that doesn't mean the latter thing is in fact true ... if the thing you assume is not true, then all bets are off as far as the truth of the latter statement.
So, if you want to know what is really true, you don;t just need a valid argument, but you also need to make sure the assumptions are true in the first place. An argument that has true assumptions is called a well-founded argument, and an argument that is valid and well-founded is called a sound argument. So, with a sound argument you can actually learn something about the world ... a valid proof is not enough to say anything about truth itself.
Contradiction and Falsehood and Proof
I also want you to understand that a contradiction is not the same as a false statement. The statement 'bananas are pink' is false, but it is not a contradiction. Indeed, from 'bananas are pink' alone we really cannot prove that 'the Moon is heavily populated by chipmunks'. Why? It is because we can imagine logically worlds where bananas are pink, but where the Moon is not heavily populated by chipmunks. So, the latter does not logically follow from the former. So you cannot prove 'anything you want' from a false statement.
Mathematical Proof
Now, what about the $2+2=5$ example? Yes, in the world of numbers, it is not true that $2+2=5$ ...but that does not mean that you can logically infer anything from that statement alone. Indeed, note how @MJD's answer derive s $\pi = 3$ with the help of other statements .. statements we normally hold true as well within the world of numbers.
So, we could say that within the world of numbers, if $2+2=5$, then $\pi =3$. As such, we can also say that $\pi =3$ mathematically follows from $2+2=5$, but we can not say that logically $\pi =3$ follows from $2+2=5$. In terms of logic, the best we can say is that $\pi =3$ follows from $2+2=5$ together with the statements we normally regard as true in the world of numbers.
Again, though, you have to understand that proving something does not mean that that thing is true. As we saw, I can mathematically prove that $\pi = 3$ if you assume that $2+2=5$. But of course that doesn't mean that in the world of numbers $\pi =3$ is in fact true.
What does this all Mean?
OK, so now let's generalize all of this, because I think that speaks more directly to your question as to how all of this generalizes. That is: is it true in general that from a false statement you can prove anything you want?
Well, now we know how to unpack this. First, by 'false' we mean 'false in a certain world'. So, consider some statement $A$ that is false in some world. Now, again, the first thing to note is that if $A$ is false in that world, then the statement $A \to B$ is true in that world, no matter whether $B$ is true of false in that world. And that has nothing to do with proofs. OK, but what about proofs? Well, again, we need to make a clear distinction about things that I can prove about that world, and things that I can prove about any world. So yes, if we assume that $A$ is false in a world, then we can prove that for that world, anything else $B$ would be true as well. Of course, as pointed out, that does not mean that $B$ is true ... or that it is false. We know nothing about $B$, because we started with a false assumption to base our proof of $B$ on.
Even worse, just because I can prove $B$ for that world, that does not mean that I can prove anything I want in general: there may be other worlds where $A$ is true but $B$ is false.
So, can I prove anything from the assumption that 'bananas' are pink? Well, I certainly cannot prove logically that the Statue of Liberty is underwater from that. I can prove for our world that the Statue of Liberty is underwater, because in our world bananas are not pink, so that contradicts the assumption that bananas are pink, and from a contradiction I can infer anything. But no, this 'proof' does not mean that the Statue of Liberty is actually underwater in our world.
In some klnd of philosophical 'other-maths', accepting the otherwise-false statement might be permitted on the grounds that accepting it necessarily changed whatever rule had previously made it unacceptable.
– Robbie Goodwin Dec 06 '23 at 22:33