You need to use forward slashes, not the pipe with a sed search and replace command.
Attempt to match regexp against the pattern space. If successful, replace that portion matched with replacement. The
replacement may contain the special character & to refer to that portion of the pattern space which matched, and the
special escapes \1 through \9 to refer to the corresponding matching sub-expressions in the regexp.
Stage that sed -e command by just typing it into the command line and when you get it working, that's how you code it within the script.
$ cat investment.txt
$ sed -e s/INVEST/DIVEST/g investment.txt
And just me nitpicking, no technical reason except to make sure some alias doesn't cause problems, I always use the full path for the command, therefore /bin/sed when I call a system command.