You have the serial monitor sending a newline character, but the text comparison does not include that character. Try setting the serial monitor to no line ending.
Af dc motor lib makes 1 correspond to motor out 1
Using l298n shield......... Just the coder for a project..... Prob is serial input = mf does not gib output as forward
As david said, your SM is sending "mf" AND a line ending. That's evident when you echo it back, see that extra blank line in SM after "mf" ? There is a setting in serial Monitor to modify the end of line that SM adds when you press enter after typing mf. Change that to nothing, and SM will only send "mf", nothing more.
you were told by three of us - change the setting in Serial Monitor to not send a line ending when you hit enter to end your entry. It's that simple. Or, if you're up for a learning experience, change your code to only evaluate the first two characters of the string ("MF"(plus a line ending)).