6、Visit localhost:8989, enter the newly added footway starting point, but the navigation route you get is not the expected walking route,I expect to get the red route
As you noticed ways added in JOSM will be assigned negative OSM IDs, that GraphHopper does not handle. If you comment out the code that checks for positive IDs in GraphHopper you will run into all sorts of trouble, so don’t do it unless you know exactly what you are doing.
Luckily this problem was addressed already by the script mentioned above, which converts the negative IDs to positive ones, so you should use it (without any further changes to GraphHopper).
Note that once you change the OSM file and run the server again you need to delete the graph folder to trigger a new import.
If you only add a single way to the file that is not connected to the remaining ways on your map it might be filtered out by GraphHopper. To disable this mechanism you would have to set prepare.min_network_size: 0 in your config file (and run a new import).
No.
Tagging it as highway=footway should be sufficient.