A lot of advice here, some better than others. Ultimately, though, it depends on your personal situation, cash reserves, etc. It also depends on what the markets (and inflation) are going to do and how disciplined you are.
I get that paying off the mortgage makes you feel good and puts you in a lower (or zero) debt situation. But the wisdom of doing so depends on how old you are, your cash position, your income, and whether you will sell the house in the next few years. Inflation/deflation impacts it too: a house is generally an appreciable asset, so paying it off more slowly if you intend to move makes sense. (Unlike a depreciable asset, like a car, where you'll be upside down). If you expect to retire or take an income hit, it might make more sense to pay it off. Good income in a inflation market? Pay it off with future dollars. Deflation market? Pay it off now. How safe will the investment be, and what kind of commission does the advisor/broker get on your investments? He/she may be motivated to get you to buy/churn stocks.
SGOTI can't answer well for your situation. The new tax law will affect real estate in many areas due to the caps on mortgage deductibility and the cap on state/local tax deductions.
You've got several options, including the "pay it now", "invest and pay monthly mortgage from current income", "invest and pay monthly mortgage from the proceeds of the investment", "pay monthly mortgage plus additional principal each month to pay it faster", and permutations of each.
No one right answer here - you need a good independent financial advisor (not one that gets commission or kickback on investment sales) that understands your individual situation. Estate planning may well factor in, too.