In Germany it's possible to vote by letter / mail. So it's possible to show somebody how you voted and send it to the election office.
Does a penalty exist for selling ballots, or for openly offering to sell a vote to somebody?
Yes, all of this would be very illegal.
Even just showing to someone how you voted can be illegal according to §107c StGB [German|English] (Violation of secrecy of elections) and could get you up to two years in prison. (To clarify as it was asked in a comment: It is of course not illegal to tell someone how you voted, but it is illegal to prove to someone how you voted).