Why does my iphone 4 flicker?

My iphone 4 flickers randomly every now and then but when it does it goes absolutely nuts.
I slide the lock and then it flickers and goes back to the lock screen and then it goes to the thing where you slide to turn it off… And you have to press cancel then it flickers back to lock screen etc etc it repeats. It gets really bad at times but then my phone is normal…
Why is it doing that? Should I get it fixed how much would it cost roughly?
(AUS)

Do you have warranty? I'd take it in it might be a problem inside it