Welcome to Inkscape Community!
The Eraser tool seems to be a stumbling block for a lot of new Inkscape users. In my experience, it's a bit buggy. I feel like I can't depend on it to work every time, and rarely use it. (Hah, really I only use it when I answer messages like this!) Fortunately, it's sort of a redundant tool. Everything the Eraser tool can do, can be done in other ways with Inkscape.
The red line that you're seeing is supposed to disappear when you release the mouse, and at the same time, the part you erase should disappear. But the heart of the problem with erasing part of an imported raster image, is that the Eraser tool won't work on raster images....at least not in Cut Out mode. In Touch mode, it will delete any whole raster image that is touched with the red line. But it can't erase only a part.
It's possible you could use clipping, to "erase" part of a raster image. But it depends on the specific circumstances. It might be better to use a raster editor (such as The GIMP, Paint.net, etc.). If you could show us the project, or describe it, we could give more direct suggestions.
For the SVG graph image, are you trying to erase part of the orange line? The Eraser probably isn't the best tool to use, on simple lines (open stroked paths). That's because the Eraser wants to close the path (the new straight segment).
To edit the orange line, there are a couple of ways to go. One (and probably the best) is using the Node tool. Here's the manual info on node editing:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Editing.html I could give you specific steps, if I know exactly what you want to do -- break the line into 2 pieces, or just make it shorter on one end.
The other way will allow the Eraser tool to work. However, it will make it much, much harder to edit that line, in the future. Select the line and do Path menu > Stroke to Path. Now the Eraser will work! But again, if you ever need to edit that line in the future, it will be quite hard to do.
Without seeing the actual SVG file, it's hard to suggest the best approach. But I hope I've answered your questions