 A very natural question to ask is, is it really necessary to check both directions when you have a potential inverse function? Do you have to really check f composed of g and g composed with f? Well, the answer to this question is really yes and no. And let me kind of explain the caveat here. So potentially, if you have two functions f and g, right? If you compose f with g and g with f, the order of operations does depend on the functions, right? We've seen many examples where f composed with g is not the same thing as g composed with f. So just on the surface, we would expect these things in general to be different. So you'd wanna check both to see that they are in fact the same function. They're both equal to x in this situation, right? That's what we're looking for. But again, if it's an inverse function on one side, it seems like it's gonna work on the other sides. What could possibly go wrong here? And so consider the following two functions. Consider f of x equals x squared and g of x equals the square root of x. It's very, we're very tempted to say that these are inverse functions for the following reason. If we do f composed with g, right, of x, this would mean we take the square root of x and we're gonna square it. And when you square the square root of x, you're gonna get back an x again, all right? And so it's like, well, okay, that looks like the identity function. But when you go the other way around, g composed with f of x, in that situation, you're gonna take the square root of x squared. People are very tempted to say that this is equal to x, but that's actually not true. This is equal to the absolute value of x. A simple counter example that is if you take the square root of two squared, you get the square root of four, which is two. On the other hand, if you take the square root of negative two squared, you're gonna get the square root of four, which is likewise two. The problem is when you take the square root after the square, you're forgetting that the number could have been negative. And so this isn't exactly an inverse relationship. The issue that is the culprit we can blame here is that the function f of x equals x squared is not a one-to-one function. And that's actually what's going on here. That's the problem. x squared is not a one-to-one function because with the numbers two and negative two, if you square two, you get four. If you square negative two, you get four. And so there's two different x-coordinates that have the same y-coordinate. And so the way we define inverse functions, we've only defined inverse functions for one-to-one functions. So x squared itself doesn't actually have us inverse because it's not one-to-one. But at the same time, we do still see this relationship that when you compose, if you do the square root and followed by the square, you get x. So it's like we're really close to having an inverse. Someone might call this like a pseudo-inverse. And it turns out x squared can have an inverse if we tweak it. The issue has to do with its domain. If you think of the standard function y equals x squared, its graph looks like the following. You get something like this, right? And the graph might look like this. We've seen this before. And the issue is it's not one-to-one because it fails the horizontal line test. But this is if we take the entire function, the entire domain of real numbers, right? What if we were to just kind of, kind of we took away half of the graph? What if we take the function f of x equals x squared where x is greater than or equal to zero? What if we restrict the domain? In this situation, you'll now see that the graph passes the horizontal line test. This is in fact now a one-to-one function. And as such, it has an inverse function. The inverse would then in fact be, f inverse is gonna be the square root of x. And the thing, and you can see this illustrated in the graph above here. In yellow, you see the half of the parabola right here. And in green, you see the square root function. You'll notice that these are mirror images of each other. We'll talk about this actually in the next video. If you restrict the domain of the parabola x square to be one-to-one, in that context, it's when it's one-to-one, it has an inverse function. That inverse function is the square root of x. And so the problem we saw earlier when we composed the square root with the square and got back x, that's because we have to shrink our domain. The reason we got the absolute value here is for the whole domain, for the whole real numbers, the whole real line there, negative zero and positives, this would be the absolute value. But if you restrict just the positive numbers, right? If x is positive, the absolute value of x is no different than x itself. So restricted to positive numbers, that is the identity. And so to answer the questions, do you have to check both directions? The answer is really no, when the functions are one-to-one. If the two functions in play are one-to-one functions, then if you check one direction and it works, you have this inverse function property. If you flip the directions, it's gonna work there as well. You can guarantee that's gonna happen. But only if the functions are one-to-one. But of course, if the functions are not one-to-one, then they can't have an inverse function. So you can automatically say, no, they're not inverse functions. So if you pay attention to this one-to-one business, which you ought to, then you really can simplify just to checking one direction. And so I hope that's a really long-winded answer to the question, but there's some subtleties going on here. It's very important the function be one-to-one. Otherwise, its inverse relationship doesn't give us a function. And to guarantee they compose to be the identity, we need the functions to be one-to-one. Otherwise, it might not work in one of the directions.