Immediately before using any move (other than Struggle), a Pokémon with Protean as its Ability will change its type(s) to match that of the move it is using. If the move used is Hidden Power, the user's type changes to the actual type of Hidden Power the user possesses.
The user's new type remains in effect until changed again, or the user is switched out; negating or replacing the Ability does not change the user back to their original typing.
So basically, it changes your Pokemon's type to the move you just used, allowing the Pokemon to get STAB off of every move it uses. So, if your greninja uses ice beam, it changes its type to ice, allowing it to get STAB and its stays ice until you use another move or if you switch out.