The code you have is certainly on the right track. Here's how I'd do it:
function tytuly_postow( $atts ) {
extract( shortcode_atts( array(
'id' => 1,
), $atts ) );
$posts = get_posts( array(
'posts_per_page' => -1,
'post_status' => 'publish',
'cat' => $id,
) );
$output = '';
if ( $posts ) {
$output .= '<p>';
foreach ( $posts as $post ) {
$output .= apply_filters( 'the_title', $post->post_title ) . '<br />';
}
$output .= '</p>';
}
return $output;
}
add_shortcode( 'tytuly', 'tytuly_postow' );
Offset by default is 0 so you don't need to add it as an argument. I've set posts_per_page to -1. This means get all.
Since you're just listing off titles it may make sense to order them by title. At the moment they'll be ordered by date descending.
I'm setting output to a blank string and returning output at the end. This means no matter what happens the shortcode will always return something, even if that something happens to be an empty string.
Then I'm checking if posts were found. If that's the case I'm adding a paragraph tag before and after the foreach. This was to match your original code.
Finally it loops through each post and uses the_title filter on the post titles then ends each title with a break tag.