You're actually not describing the problem correctly. When TeXstudio fails to recognize an environment, it is the \begin and \end that are highlighted red. For example if I add an environment foo, I get this:

The "unrecognized command" popup comes from hovering the mouse cursor over \begin. (Sorry, it didn't show up in screenshot.)
The problem you're facing is a different one: that you've used math mode-only code outside of math mode. The proof environment does not start math mode. And TeXstudio tells you that this is the case:

Additional note
I just saw that you're using $$ ... $$ for displayed math. Don't do this, use \begin{equation*} ... \end{equation*} or \[ .. \] instead, see Why is \[ … \] preferable to $$?
amsmathdoesn't deal with theorem-like environments, that is whatamsthmdoes. Try activating thecwlforamsthm. – Torbjørn T. Feb 26 '18 at 10:38\usepackage{amsthm}already, no need for more than one. But I think I realized your mistake. Theproofenvironment itself is recognized (not highlighted in red), but the thing is that it is not a math environment. To use math inside aproof, you need e.g.$...$for inline math, or analignenvironment for multi-line math with alignment. – Torbjørn T. Feb 26 '18 at 10:51