Is the identity function a one-way function? The definition of the one way function says:


it must be verifiable in polynomial time
probability of inverting it less or equal to negligible


Now, I am not sure I fully understand one way functions.


Can I say that $f(x) = x$ is a one way function?
Do we assume that we know how $f$ is defined?
if $x$ is of length $l$, then the probability of guessing it is: $(1/2)^l$ which is negligible.


I am pretty sure that my reasoning is wrong, any hint?
It is not one-way because there is an efficient algorithm which inverts it with probability $1$; namely an algorithm which simply outputs its input.

The fact that we "know the function" is implicit in that no restriction is placed on how the algorithm is "devised", it is only required that such an algorithm exists.