Recursively swap the left and right children of every node.
For each node:
- Recursively invert the left subtree.
- Recursively invert the right subtree.
- Swap the left and right children.
The base case: if the node is null, return null.
You can also do this iteratively using BFS or DFS with a stack, visiting each node and swapping its children.