If it does repeat 'everywhere' (as in 'no matter which app you tap, it's always faulty') then it's definitely hardware. If sometimes it works and sometimes it doesn't, it might be both, but I'm leaning more on 'hardware'.
You can try this: If you haven't enabled "Developer Options", do so (Go into Settings, More, About Device, and click a bunch of times in rapid succession on "Build Number"). Now, go into Developer Options to the "Input" section. There, enable "Show touches" and "Show pointer location". This should show on screen a trace of everything your phone is recognizing and the location of the pointer (your finger). If you trace a line on that area without lifting your finger and the trace shows a complete line, then your hardware is OK. If it doesn't, you should take it for warranty replacement right away.
If it DOES show the complete trace, that means your screen is recognizing the input but the software isn't. Try factory resetting your phone and see if that helps. If it doesn't, you'd still need to take it for warranty replacement.
Hope this helps
