The simplest way to obtain the expression created by the C# compiler is to affect it to a variable of the correct type, and looking at it in a debugger; in your case:
Expression<Func<User, bool>> lambdaExpression =
u => u.id == 5 && db.UserGroups.Any(d => d.user_id == u.id);
And then look at the lambdaExpression
variable in a debugger.